File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML-unique

 
Abhi Venu
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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















 
Venkata Kumar
Ranch Hand
Posts: 110
Firefox Browser Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<xs:selector xpath="Address /country">
<xs:field xpath="." />


You may try this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic