1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/importnode.py Tue Dec 28 00:20:03 2004 +0000
1.3 @@ -0,0 +1,23 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +import libxml2dom
1.7 +import sys
1.8 +
1.9 +d = libxml2dom.parse(sys.argv[1])
1.10 +root = d.xpath("*[1]")[0]
1.11 +d2 = libxml2dom.createDocument(None, "new", None)
1.12 +root2 = d2.xpath("*[1]")[0]
1.13 +for i in range(0, 10):
1.14 + imported = d2.importNode(root, 1)
1.15 + root2.appendChild(imported)
1.16 +libxml2dom.toStream(d2, sys.stdout)
1.17 +del root2
1.18 +_d2 = d2.as_native_node()
1.19 +del d2
1.20 +_d2.freeDoc()
1.21 +del root
1.22 +_d = d.as_native_node()
1.23 +del d
1.24 +_d.freeDoc()
1.25 +
1.26 +# vim: tabstop=4 expandtab shiftwidth=4
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/tests/prettyprint.py Tue Dec 28 00:20:03 2004 +0000
2.3 @@ -0,0 +1,10 @@
2.4 +#!/usr/bin/env python
2.5 +
2.6 +import libxml2dom
2.7 +from xml.dom.ext import PrettyPrint
2.8 +import sys
2.9 +
2.10 +d = libxml2dom.parse(sys.argv[1])
2.11 +PrettyPrint(d)
2.12 +
2.13 +# vim: tabstop=4 expandtab shiftwidth=4