[jdom-interest] No duplicates element's values in a list of
element
Tatu Saloranta
cowtowncoder at yahoo.com
Tue Oct 2 12:38:24 PDT 2007
And of course you can use Relax NG (http://relaxng.org/) validation, which combines power of w3c Schema, and quite readable syntax (esp. with the compact notation).
While w3c schema has its uses (mostly for data binding), its not all that good for validation. RNG on the other hand is specifically designed for validation, and is very good at that.
There both stand-alone RNG validators (Multi-schema Validator, yang) and many xml parsers natively support validation (not sure about Xerces, but Woodstox uses msv to implement full parser and writer-side RNG validation; and I think you can plug-in generic sax validator with Xerces). Also, I think Saxon xslt/xquery processor can probably do RNG validation as well.
-+ Tatu +-
----- Original Message ----
From: Grzegorz Kaczor <grzegorz.kaczor at gmail.com>
To: NP <nicola.padovano at gmail.com>
Cc: jdom-interest at jdom.org
Sent: Tuesday, October 2, 2007 1:39:26 AM
Subject: Re: [jdom-interest] No duplicates element's values in a list of element
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: jdom-interest-bounces at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of NP
Sent: Monday, October 01, 2007 2:45 PM
To: jdom-interest at jdom.org
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/youraddr@yourhost.com
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
--
"Choć tyle wiemy własnym doświadczeniem:
W nas jest Raj, Piekło - i do obu - szlaki."
J.K.
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071002/5050bbd7/attachment.htm
More information about the jdom-interest
mailing list