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