[xml] document node



Hello,

 

I have a document that looks like this:

<data><message/></data>

 

I would expect XPath '/data/message/ancestor-or-self::*' to return three nodes: document node (the node with type XML_DOCUMENT_NODE), ‘data’ node (the root node) and ‘message’ node. I don’t get the document node though.

 

Is it a bug or is it correct? What I found about root and document nodes was quite confusing, so I am not sure.

 

Anyway, it could be fixed in xmlXPathNodeCollectAndTest for NODE_TEST_ALL case to include document node as well as element nodes. And then I had to fix also comparing the nodes for document order (having document node always before any other node). And there would be probably more places, that would need some fix for document node.

 

Vojtech



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]