Re: [xml] SelectSingleNode

On Tue, May 03, 2011 at 03:42:56PM -0400, Paul B. Cameron wrote:
I believe I'm able to answer my own questions:

1. Use xmlGetNodePath to build the node path instead of rolling a custom

  right !

2. There is no need to return a copy of a node retrieved by an XPath
evaluation - node pointers returned by the query point to the actual node
memory in the tree. These nodes do not become invalid when the query object
or context are freed. 

  And right ! ... except for the nasty case of namespace nodes, where
libxml2 model and XPath data model don't match and as a result the
namespace nodes returned in an XPath query don't come from the tree
(but are freed when the XPath object is freed).


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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