[xml] xpointer with python-libxml2?



Hello,

I am tesing the libxml2 python wrapper for libxml2 2.5.4. 

I know that xinclude and xpointer are available in libxml2. When I 
process an XML document containing (example):
<a>
<xi:include href="/dev/d/d/xml/program/python.xml#xpointer
(//python/libs)" parse="xml" 
xmlns:xi="http://www.w3.org/2001/XInclude";>
<xi:fallback/>
</xi:include>
</a>

...using xsltproc, the resulting xml correctly includes the section from 
the external XML document. When I process the same XML document 
with python using:

import libxml2
doc = libxml2.parseFile("sample.xml")
branch = doc.xpathEval("a")

...or however...the link in no case seems to get recognized. Some 
scripts return an error like:

"""
XPath error Undefined namespace prefix
/a/xi:include/xi:fallback
                                        
xmlXPathEval: evaluation failed
"""

Should the python libxml2 wrapper recognize xpointers like this? If so, 
can anyone 'point' me to some examples of the implementation?

Thanks,
Ben

This is your brain:
    bash-2.05$
This is your brain on drugs:
    Starting Windows XP...
Any questions?

Get your free 15MB mailbox on Lycos Email - http://mail.lycos.co.uk



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