Hello,

I have parsed an OpenOffice.org document (content.xml) and tried to get a
list of all "table:table" elements. Therefore I used the following code.

Document doc = reader.read(myFile);
List list1 = doc.selectNodes("//table:table");
Element body =
(Element)doc.selectSingleNode("/office:document-content/office:body").detach();
List list2 = body.selectNodes("//table:table");

The first call of selectNodes works fine. list1 contains all "table:table"
elements. But when I detach the "office:body" element (is a child of the
root element) and call the selectNodes from body I always get an empty
list. But all "table:table" elements are descendants of "office:body". So
the result should be the same.

Does selectNodes work correctly only on nodes that are part of an existing
document and not on nodes that are detached from an document? That's the
only difference I can see.

Kind regards,
Andreas



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to