Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] No duplicates element's values in a list
 of  element

NP

2007-10-02


but it's a good programming using a java method to control that a
element's value is not duplicate?
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
From jdom-interest-bounces@(protected)
Return-Path: <jdom-interest-bounces@(protected)>
Delivery-Date: Tue, 02 Oct 2007 16:51:38 -0400
Received-SPF: none (mxus6: 65.212.180.182 is neither permitted nor denied by domain of jdom.org) client-ip=65.212.180.182; envelope-from=jdom-interest-bounces@(protected);
Received: from [65.212.180.182] (helo=servlets.kattare.com)
 by mx.perfora.net (node=mxus6) with ESMTP (Nemesis)
 id 0MKorw-1IcoiQ1hhf-0003Zg for java@(protected)
Received: from servlets.kattare.com (localhost [127.0.0.1])
 by servlets.kattare.com (8.12.10/8.12.11) with ESMTP id l92JcUGc017145;
 Tue, 2 Oct 2007 12:38:32 -0700
Received: from web32805.mail.mud.yahoo.com (web32805.mail.mud.yahoo.com
 [68.142.206.35])
 by servlets.kattare.com (8.12.10/8.12.11) with SMTP id l92JcRkp023046
 for <jdom-interest@(protected)
Received: (qmail 83015 invoked by uid 60001); 2 Oct 2007 19:38:24 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
 h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID;
 b=x3DEhxvUgfzbPRAPfOJNChwEFkXXn0iSfCdwAwn2qaPK7sHoQKKFca0/sR7/YlPHTLuo/yOIy3ps5916PM+mH+xZWp5uZMDxAOXvvQOMg/0FnuCdblspmiA8ruznFL+79kgXpEk9pXu1c8b6Ub8e9hRtytWFnewOTe11UF5YS4U=;
X-YMail-OSG: Q7p2J1QVM1krCisXDHYGQWHXpE6_uN.tXnmkgsajGpJDgCTGU2q48PWCrVRFU_ppGYK1tvSUbNqtpHS5ZyLxqnasCFglBzXbQ_2MGM7dGDicdsqXvFj2uv183x3fAQ--
Received: from [209.191.118.120] by web32805.mail.mud.yahoo.com via HTTP;
 Tue, 02 Oct 2007 12:38:24 PDT
X-Mailer: YahooMailRC/651.50 YahooMailWebService/0.7.134
Date: Tue, 2 Oct 2007 12:38:24 -0700 (PDT)
From: Tatu Saloranta <cowtowncoder@(protected)>
Subject: Re: [jdom-interest] No duplicates element's values in a list of
 element
To: jdom-interest@(protected)
MIME-Version: 1.0
Message-ID: <710739.83000.qm@(protected)>
X-BeenThere: jdom-interest@(protected)
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: JDOM Mailing List for General Issues and Updates
 <jdom-interest.jdom.org>
List-Unsubscribe: <http://www.jdom.org/mailman/listinfo/jdom-interest>,
 <mailto:jdom-interest-request@(protected)>
List-Archive: <http://www.jdom.org/pipermail/jdom-interest>
List-Post: <mailto:jdom-interest@(protected)>
List-Help: <mailto:jdom-interest-request@(protected)>
List-Subscribe: <http://www.jdom.org/mailman/listinfo/jdom-interest>,
 <mailto:jdom-interest-request@(protected)>
Content-Type: multipart/mixed; boundary="===============1695928645=="
Sender: jdom-interest-bounces@(protected)
Errors-To: jdom-interest-bounces@(protected)
Envelope-To: java@(protected)

--===============1695928645==
Content-Type: multipart/alternative; boundary="0-1704891118-1191353904=:83000"

--0-1704891118-1191353904=:83000
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: quoted-printable

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 comp=
act notation).=0AWhile w3c schema has its uses (mostly for data binding), i=
ts not all that good for validation. RNG on the other hand is specifically =
designed for validation, and is very good at that.=0AThere both stand-alone=
RNG validators (Multi-schema Validator, yang) and many xml parsers nativel=
y support validation (not sure about Xerces, but Woodstox uses msv to imple=
ment full parser and writer-side RNG validation; and I think you can plug-i=
n generic sax validator with Xerces). Also, I think Saxon xslt/xquery proce=
ssor can probably do RNG validation as well.=0A=0A-+ Tatu +-=0A=0A----- Ori=
ginal Message ----=0AFrom: Grzegorz Kaczor <grzegorz.kaczor@(protected)=
: NP <nicola.padovano@(protected)=
ay, October 2, 2007 1:39:26 AM=0ASubject: Re: [jdom-interest] No duplicates=
element's values in a list of element=0A=0AHhmm I don't know of anything i=
n a DTD that will allow that. Seems like=0Aa java method is the way to go.=
=0A=0AOr XML Schema which is a more modern and much more powerful validatio=
n mechanism. Unfortunately, more difficult to learn and a bit rough in synt=
ax. In schema you can use the uniqueness key to ensure uniqueness of name e=
lement values.=0A=0A=0AFor an example of validation using schema, see here:=
http://cafeconleche.org/books/xmljava/chapters/ch14s10.html=0A=0AGrzegorz=
=0A =0A=0A=0A-----Original Message-----=0AFrom: jdom-interest-bounces@(protected).=
org=0A=0A[mailto:jdom-interest-bounces@(protected)=
nday, October 01, 2007 2:45 PM=0ATo: jdom-interest@(protected): [=
jdom-interest] No duplicates element's values in a list of=0Aelement=0A=0AH=
i!=0A=0Alet's suppose that we have this xml:=0A...=0A<name>name1</name>=0A<=
name>name2</name>=0A=0A...=0A<name>nameN</name>=0A=0AIs there a ddt rule th=
at forces to don't have duplicate value of name?=0Aor: i must write a funct=
ion (using jdom) that recovers all the elements=0Aand controls if there is =
a duplicate value?=0A=0A_______________________________________________=0AT=
o control your jdom-interest membership:=0Ahttp://www.jdom.org/mailman/opti=
ons/jdom-interest/youraddr@(protected)=
____________________=0ATo control your jdom-interest membership:=0Ahttp://w=
ww.jdom.org/mailman/options/jdom-interest/youraddr@(protected)=
=0A=0A-- =0A"Cho=E6 tyle wiemy w=B3asnym do=B6wiadczeniem:=0AW nas jest Raj=
, Piek=B3o - i do obu - szlaki."=0AJ.K.=0A=0A=0A=0A=0A=0A=0A     =0A_____=
___________________________________________________________________________=
____=0ANeed a vacation? Get great deals=0Ato amazing places on Yahoo! Trave=
l.=0Ahttp://travel.yahoo.com/
--0-1704891118-1191353904=:83000
Content-Type: text/html; charset=iso-8859-2
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:times new roman, new york, times, serif;=
font-size:12pt"><div style=3D"font-family: times new roman,new york,times,s=
erif; font-size: 12pt;"><span>And of course you can use Relax NG (<a target=
=3D"_blank" href=3D"http://relaxng.org/">http://relaxng.org/</a>) validatio=
n, which combines power of w3c Schema, and quite readable syntax (esp. with=
the compact notation).</span><br>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.<br>Ther=
e both stand-alone RNG validators (Multi-schema Validator, yang) and many x=
ml parsers natively support validation (not sure about Xerces, but Woodstox=
uses msv to implement full parser and writer-side RNG validation; and I th=
ink you can plug-in generic sax validator with Xerces). Also, I think Saxon
xslt/xquery processor can probably do RNG validation as well.<br><br>-+ Ta=
tu +-<br><br><div style=3D"font-family: times new roman,new york,times,seri=
f; font-size: 12pt;">----- Original Message ----<br>From: Grzegorz Kaczor &=
lt;grzegorz.kaczor@(protected)=
;<br>Cc: jdom-interest@(protected)=
M<br>Subject: Re: [jdom-interest] No duplicates element's values in a list =
of element<br><br><div><blockquote class=3D"gmail_quote" style=3D"border-le=
ft: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: =
1ex;">Hhmm I don't know of anything in a DTD that will allow that.&nbsp;&nb=
sp;Seems like<br>a java method is the way to go.=0A</blockquote><div><br>Or=
XML Schema which is a more modern and much more powerful validation mechan=
ism. Unfortunately, more difficult to learn and a bit rough in syntax. In s=
chema you can use the uniqueness key to ensure uniqueness of name element v=
alues.=0A<br><br>For an example of validation using schema, see here: <a re=
l=3D"nofollow" target=3D"_blank" href=3D"http://cafeconleche.org/books/xmlj=
ava/chapters/ch14s10.html">http://cafeconleche.org/books/xmljava/chapters/c=
h14s10.html</a><br><br>Grzegorz<br>&nbsp;</div>=0A<br><blockquote class=3D"=
gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0p=
t 0pt 0pt 0.8ex; padding-left: 1ex;">-----Original Message-----<br>From: <a=
rel=3D"nofollow" target=3D"_blank" href=3D"mailto:jdom-interest-bounces@(protected)=
om.org">jdom-interest-bounces@(protected)=
" target=3D"_blank" href=3D"mailto:jdom-interest-bounces@(protected)=
erest-bounces@(protected)=
07 2:45 PM<br>To: <a rel=3D"nofollow" target=3D"_blank" href=3D"mailto:jdom=
-interest@jdom.org">jdom-interest@(protected)=
t] No duplicates element's values in a list of<br>element<br><br>Hi!<br><br=
>let's suppose that we have this xml:<br>...<br>&lt;name&gt;name1&lt;/name&=
gt;<br>&lt;name&gt;name2&lt;/name&gt;=0A<br>...<br>&lt;name&gt;nameN&lt;/na=
me&gt;<br><br>Is there a ddt rule that forces to don't have duplicate value=
of name?<br>or: i must write a function (using jdom) that recovers all the=
elements<br>and controls if there is a duplicate value?=0A<br>____________=
___________________________________<br>To control your jdom-interest member=
ship:<br><a rel=3D"nofollow" target=3D"_blank" href=3D"http://www.jdom.org/=
mailman/options/jdom-interest/youraddr@(protected)=
ilman/options/jdom-interest/youraddr@(protected)=
____________________________________<br>To control your jdom-interest membe=
rship:<br><a rel=3D"nofollow" target=3D"_blank" href=3D"http://www.jdom.org=
/mailman/options/jdom-interest/youraddr@(protected)=
ailman/options/jdom-interest/youraddr@(protected)><=
/div><br><br clear=3D"all"><br>-- <br>"Cho=E6 tyle wiemy w=B3asnym do=B6wia=
dczeniem:<br>W nas jest Raj, Piek=B3o - i do obu - szlaki."<br>J.K.=0A</div=
><br></div></div><br>=0A    <hr size=3D1>Moody friends. Drama queens. You=
r life? Nope! - their life, your story.<br> <a href=3D"http://us.rd.yahoo.c=
om/evt=3D48224/*http://sims.yahoo.com/">Play Sims Stories at Yahoo! Games. =
</a></body></html>
--0-1704891118-1191353904=:83000--

--===============1695928645==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
--===============1695928645==--
©2008 junlu.com - Jax Systems, LLC, U.S.A.