# HG changeset patch # User paulb # Date 1174604992 0 # Node ID 274a1618ae9e37dfe40e857055fc49016b653449 # Parent 46e0b1bc03cd44d5e2eaaf21bb219edb33482ed5 [project @ 2007-03-22 23:09:52 by paulb] Added a test of CDATA import. diff -r 46e0b1bc03cd -r 274a1618ae9e tests/importcdata.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/importcdata.py Thu Mar 22 23:09:52 2007 +0000 @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-15 -*- + +import libxml2dom +d = libxml2dom.parseString(""" + + + +""") +d2 = libxml2dom.createDocument("http://www.w3.org/1999/xhtml", "html", + libxml2dom.createDocumentType("html", "-//W3C//DTD XHTML 1.1//EN", "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd")) +doc = d.xpath("doc")[0] +doc2 = d2.importNode(doc, 1) +html = d2.xpath("*")[0] +html.appendChild(doc2) + +print d2.toString("iso-8859-15") + +# vim: tabstop=4 expandtab shiftwidth=4