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="";
      <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 ""; 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 Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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