Re: [xml] Relative XPath search



On Wed, Jul 13, 2005 at 10:31:08AM +0200, m curcio libero it wrote:
My application needs to be able to do that even if "xmlNode" does not belong to any DOM (that is, a subtree 
of nodes created by scratch). I tried to do this:

// Create xpath evaluation context
xpathCtx = xmlXPathNewContext(NULL);

and it seems to be working properly. 
But I wonder, is that safe ?

  This should be safe as long as none of the XPath expressions need to
access the root, but this is a non-common situation so you are exposing
yourself to potential bugs that may have been unnoticed because everybody
tests with document where all nodes refers to a doc.
  I can't give a formal "this is safe" statement.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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