I think you're both right ;-)

How about a compromise:

* we add a warning to the JavaDoc that if you change the document in any way
then the XPath may no longer work.
* I add a patch such that the index notation [2] is used if there are
multiple siblings with the same QName.

such that

/root/nodeA/nodeB[2]/@attribute would occur if nodeA had 2 nodeB nodes but
root had only one nodeA node.

Sound like a good plan?

James
----- Original Message -----
From: "Emmanuel Dupouy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 31, 2001 11:51 PM
Subject: RE: [dom4j-dev] getPath()


>The greater
>specificity is also more frangible: change something, even if it is not
>in the ancestor axis for the node in question, and there's the
>possibility that it will make this XPath point at the wrong thing (for
>instance, in /root/nodeA[1]/nodeB[2]/@attribute, removing nodeB[1]
>while you have a reference to this XPath may result in an empty
>node-set, even though the XPath was generated from an existing node,
>and none of that node's ancestors have been modified).

It's sure that if you modify the tree all xpath generation methods will
produce wrong path even they use position or not.


>I'd personally just use equals(), since XML tags are case-sensitive.
I agree I forget this important feature of XML...

Emmanuel


=========================================================================
Ce message et toutes les pièces jointes sont propriété de VALTECH et
susceptibles de contenir des informations confidentielles à l'intention
exclusive de ses destinataires. Si vous avez reçu ce message par erreur
ou si celui ci vous est parvenu incomplet ou altéré, merci d'en avertir
l'expéditeur par retour.Toute utilisation, diffusion ou publication non
expressément autorisée par nous par écrit est strictement interdite.
 --------------------------------------------------------------------------
This message and any attachments are Valtech property and may contain
iconfidential information intended solely for the addressees. If your are
not the intended recipient of this message or if you have received it
uncomplete or altered, please notify the author by replying to his e-mail
immediately. Any unauthorised use, diffusion or dissemination not
expressly authorised by us in writing is strictly prohibited.
=========================================================================
Copyright Valtech 2000



_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev




_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to