Re: [xml] a question about getting the element content with name space



On Mon, Nov 10, 2003 at 11:35:26PM -0800, Momena Akter Ahmed wrote:
Here is my xpath :
child::node2='test'

It worked okay. But after I added the namespace stuff,
how do I compose my xpath query to compare the content
of the child node ?

  child::ns:node2='test'
but you need to have the namespace prefix 'ns' defined in the
XPath context. In XSLT it's inherited from the node containing
the XPath expression. Outside XSLT there is no specification defining
this. The API is 

http://xmlsoft.org/html/libxml-xpathInternals.html#xmlXPathRegisterNs

to register a namespace to an XPath evaluation context.

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]