This week's book giveaway is in the
General Computing
forum.
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Engineering
»
XML and Related Technologies
Author
XML-unique
Abhi Venu
Ranch Hand
Joined: Jul 09, 2009
Posts: 72
posted
Mar 29, 2010 02:32:53
0
<Address>
<country>India</country>
</Address>
<Address>
<country>India</country>
</Address>
I need to create an XML with following restriction .It can have multiple address elements; inside each address there will be a element country
The country name under each Address block should be unique. it should not get repeated i.e No two address Block can have same country field
I used <xs:unique name="Country_name">
<xs:selector xpath="Address /country">
<xs:field xpath="." />
</xs:unique>
but it will impose restriction only on a Address block and not in two different address blocks
A table, a chair, a bowl of fruit and a violin; what else does a man need to be happy?:Einstein
Venkata Kumar
Ranch Hand
Joined: Apr 16, 2008
Posts: 110
I like...
posted
Mar 29, 2010 04:12:43
0
<xs:selector xpath="Address /country">
<xs:field xpath="." />
You may try this
<xs:selector xpath="*/Address"> <xs:field xpath="Country" />
SCJP 5.0, SCWCD 5, preparing for SCDJWS
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: XML-unique
Similar Threads
Unique constrain using XML Schema
Search for a specific ID
tag-value should be unique ...
XML schema unique validation is not working
XML: Unique
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter