Re: [xml] xmllint --shell : xpath is not working? (libxml2-2.6.4)



On Fri, Jan 23, 2004 at 10:42:43AM +0100, Stefan Kost wrote:
hi hi,

can anyone confirm and/or explain that?

  Confirm taht it is actually working,

xmllint --shell giml/gitkTemplate_message.xml
<giml xmlns="http://gitk.sourceforge.net/";
[...]
      <widget id="Message" type="label"/>
[...]
/ > xpath //widget
Object is a Node Set :
Set contains 0 nodes:
/ >

  it's an XPath FAQ, a non qualified name do not select namespaced nodes.
And widget is in the "http://gitk.sourceforge.net/"; namespace.
You can try xpath //*[localname = 'widget'] to confirm this.
XPath wasn't designed to be used in isolation, the specifications
embedding it have to provide the mechanism to bind namespaces,
then something like //gimp:widget would work.

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]