Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

XML-unique

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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















 
Ranch Hand
Posts: 110
Firefox Browser MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<xs:selector xpath="Address /country">
<xs:field xpath="." />



You may try this
 
reply
    Bookmark Topic Watch Topic
  • New Topic