Hello all.  I have already sent this message to James but since I've
committed myself to dom4j I've joined the mailing list and sending it to
everyone.  Anyway, I think a bug has been introduced into the .4 release of
dom4j.  Prior to .4, if you made a selection from an Element using an XPath
xpression, the xpression evaluated with the Element as the current context
node.  That no longer works.  I think the expression is being evaluated
using the root node as the context node.  For example:

/* XML snippet */
<root>
 <element1>
  <element2>some data</element2>
 </element1>
</root>


/* Java snippet */
Element root = document.getRootElement();

 // This no longer works
Element element2 = (Element)root.selectSingleNode( "/element1/element2" );

// This works
Element element3 = (Element)root.selectSingeNode( "//element1/element2" );


I went back and downloaded dom4j-0.3 and changed my classpath.  I re-ran my
program and it works as expected to.  So I'm sure that the bug has something
to do with the .4 release.  Any help is appreciated because I would prefer
not having to go back and change other code that I have that expects the
current element to be the context node for an xpath xpression.

Thanx

Dane Foster
Equity Technology Group, Inc
http://www.equitytg.com.
954.360.9800


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

Reply via email to