| Author |
validate an element for unique value in multiple occuranes
|
Priti Shah
Ranch Hand
Joined: May 10, 2005
Posts: 43
|
|
Hi, I have this xml which allows multiple occurences of log file locations. <some-element> <log>log location 1</log> <log>log location 2</log> <log>log location 3</log> <log>log location 4</log> </some-element> Now in my schema I want to check for max occurances 4 which I can do using 'maxOccur' attribute. But I also want to make sure that all 4 elements should have different values. How can I do that ? Thanks in advance.
|
 |
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
|
|
Welcome to Javaranch. [Sorry about the delayed reply, I had to dust-off my XSD book to answer this.] The construct you are looking for is xsd:unique. Use something like - You need to place this in the context in which you want to impose the uniqueness constraint. More homework to do....... - m
|
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
|
 |
 |
|
|
subject: validate an element for unique value in multiple occuranes
|
|
|