1 #!/usr/bin/env python 2 3 import libxml2dom 4 5 s = """<?xml version="1.0"?> 6 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude"> 7 <body> 8 <p> 9 <xi:include href="tests/test_xinclude.xhtml" 10 xpointer="xmlns(html=http://www.w3.org/1999/xhtml)xpointer(/html:html/html:body/html:p/node())"/> 11 </p> 12 </body> 13 </html> 14 """ 15 16 d = libxml2dom.parseString(s) 17 print "Result of XInclude processing:", d.xinclude() 18 print 19 print d.toString() 20 21 # vim: tabstop=4 expandtab shiftwidth=4