• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to make an element value unique within entire instance document?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, please take a look at this schema and tell me how I can make the value of my AttachmentKey element(s) unique within the entire instance document.

I know that I have to use <key> or <unique>, but I can't get it to work, as I don't have much knowledge of xpath.

here is my schema:




As you can see, AttachmentKey is a subelement of Attachment, and is used in more than one place in the example above. I want it so that when the instance document is created, no matter how many instances of Attachment is in it, each AttachmentKey value is unique, so that I can use them as keys.

So this following instance doc would be invalid:


But this one would be valid:

[ July 26, 2004: Message edited by: Robert Dang ]
[ July 26, 2004: Message edited by: Robert Dang ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic