Re: [libxml++] xpath with namespaces



On Mon, 2004-12-20 at 02:51 -0500, Daniel Veillard wrote:
> > > > >  If I use "//gjob:Jobs" i get "XPath error : Undefined namespace prefix",
> > > > >  and "//Jobs" just returns an empty set.
> 
>   Perfectly normal, the expression uses the gjob prefix and it was not
> registered.

Isn't this what
<gjob:Helping xmlns:gjob="http://www.gnome.org/some-location";>
does?

The whole document can be seen here:
http://cvs.gnome.org/viewcvs/libxml%2B%
2B/examples/sax_exception/example.xml?view=markup

> > > > >  I assume I have to register the namespace first, but I couldn"t find
> > > > >  anything about this in the documentation.
> 
>   http://xmlsoft.org/html/libxml-xpathInternals.html#xmlXPathRegisterNs
>   at the C level, it may not be available in libxml++

Thanks Daniel. At the moment, we hide the xmlXPathContext completely
inside our Node::find(xpath) function, so we would have to create some
XPathContext object that can be passed around.

Is that a concept that exists in a standard, or just something that
allows libxml users to work around broken documents? Many of the
functions look quite internal. Are there any higher-level documents that
explain what they might be used for?

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com






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