Support Requests item #1078319, was opened at 2004-12-03 13:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=216035&aid=1078319&group_id=16035

Category: None
Group: None
Status: Open
Priority: 5
Submitted By: fox_242 (fox_242)
Assigned to: Nobody/Anonymous (nobody)
Summary: XPath only works for elements within a document

Initial Comment:
XPath works (selectNodes etc.) only for elements within
a document. Please fix this or write a large warning in the
java doc.

Example:
        public static void main (String []args) throws
DocumentException {
                Document documentManual =
DocumentHelper.createDocument();
                
                Element result = new DefaultElement("publicationData");
                Element content = new DefaultElement("sdiContent");
                content.addText( "Full Text");
                result.add(content);
                
                System.out.println("result = "+result.asXML());
                System.out.println("Searching element without
doument: "+result.selectSingleNode("//sdiContent"));
                
                documentManual.add(result);
        
                System.out.println("After adding the element to a
document: "+result.selectSingleNode("//sdiContent"));
        }


This prints the following result:
result = <publicationData><sdiContent>Full
Text</sdiContent></publicationData>

Searching element without do

ument: null

After adding the element to a document:
[EMAIL PROTECTED] [Element:
<sdiContent attributes: []/>]


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=216035&aid=1078319&group_id=16035


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to