Re: No duplicates element's values in a list of element

"Grzegorz Kaczor" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
>
> Hhmm I don't know of anything in a DTD that will allow that.  Seems like
> a java method is the way to go.


Or XML Schema which is a more modern and much more powerful validation
mechanism. Unfortunately, more difficult to learn and a bit rough in syntax.
In schema you can use the uniqueness key to ensure uniqueness of name
element values.

For an example of validation using schema, see here:
http://cafeconleche.org/books/xmljava/chapters/ch14s10.html

Grzegorz


-----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of NP
> Sent: Monday, October 01, 2007 2:45 PM
> To: [email protected]
> Subject: [jdom-interest] No duplicates element's values in a list of
> element
>
> Hi!
>
> let's suppose that we have this xml:
> ...
> <name>name1</name>
> <name>name2</name>
> ...
> <name>nameN</name>
>
> Is there a ddt rule that forces to don't have duplicate value of name?
> or: i must write a function (using jdom) that recovers all the elements
> and controls if there is a duplicate value?
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/[email protected]
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/[email protected]
>



-- 
"Choć tyle wiemy własnym doświadczeniem:
W nas jest Raj, Piekło - i do obu - szlaki."
J.K.

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.