Re: [xml] xmlParseFile and xmlns
- From: Daniel Veillard <veillard redhat com>
- To: Michael Ludwig <mlu as-guides com>
- Cc: xml gnome org
- Subject: Re: [xml] xmlParseFile and xmlns
- Date: Wed, 22 Apr 2009 11:37:27 +0200
On Wed, Apr 22, 2009 at 11:24:51AM +0200, Michael Ludwig wrote:
Juhani Connolly schrieb:
If anyone knows what causes this issue and how to get around it
correctly I would really appreciate any solution/explanation that
could be given.
I don't know the C API, but you have to register namespaces with
prefixes in the XPath context and then search for //atom:item. Maybe
this pointer to the API doc will lead you on the right track:
http://xmlsoft.org/html/libxml-xpath.html#xmlXPathContext
  http://xmlsoft.org/html/libxml-xpathInternals.html#xmlXPathRegisterNs
  xmlXPathRegisterNs is what you need. You create the XPath context for
the document, register the namespace with a non-null prefix e.g. atom
and add the prefix to the query as indicated.
daniel
-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]