Re: [xml] Using Xpath from a node



On Wed, Feb 18, 2004 at 05:07:02PM +0200, Israel Ganor wrote:
Thanks, it works fine.

Is there a performance penalty when working with (relative) Xpath to find a
single child of the current node, vs. looping through all the node's
children until I find the requested child? Assume the node itself has no
more than 10 child elements in one level only (no grandchildren).

  Well ... yes it's more costly to use XPath than walk directly the
children list, though you can precompile the query and reuse the context
for different document or subtree.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]