1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/importcdata.py Thu Mar 22 23:09:52 2007 +0000
1.3 @@ -0,0 +1,19 @@
1.4 +#!/usr/bin/env python
1.5 +# -*- coding: iso-8859-15 -*-
1.6 +
1.7 +import libxml2dom
1.8 +d = libxml2dom.parseString("""<?xml version='1.0' encoding="iso-8859-15"?>
1.9 +<doc>
1.10 + <![CDATA[I am the character data champion! æøåÆØÅ]]>
1.11 +</doc>
1.12 +""")
1.13 +d2 = libxml2dom.createDocument("http://www.w3.org/1999/xhtml", "html",
1.14 + libxml2dom.createDocumentType("html", "-//W3C//DTD XHTML 1.1//EN", "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"))
1.15 +doc = d.xpath("doc")[0]
1.16 +doc2 = d2.importNode(doc, 1)
1.17 +html = d2.xpath("*")[0]
1.18 +html.appendChild(doc2)
1.19 +
1.20 +print d2.toString("iso-8859-15")
1.21 +
1.22 +# vim: tabstop=4 expandtab shiftwidth=4