Hi dom4j users,
I am having a bit of trouble selecting comment nodes that are attached to the root element, i.e. siblings of other nodes. My tree looks like this:
<ROOT>
<AAA/>
<!-- My Comment node -->
<BBB/>
</ROOT>


I want to get the comment node that is between nodes AAA and BBB. I have tried:
List list = m_Doc.selectNodes("/ROOT/AAA/following-sibling::*"); which just selects the BBB nodes and skips the comment node.
and I also tried:
List list = m_Doc.selectNodes("/ROOT/AAA/comment()"); which doesn't select anything.


I have also experimented with other XPath expression which unfortunately also do not work. The only way I get comment() function to work is if the comment node is a child of AAA or BBB.

If anyone can tell me how this can be done, I will truly appreciate it!


many thanks,



Barry




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to