1.1 --- a/tests/namespaces.py Sun Dec 11 20:28:14 2005 +0000
1.2 +++ b/tests/namespaces.py Sun Dec 11 20:28:38 2005 +0000
1.3 @@ -5,8 +5,10 @@
1.4 document = libxml2dom.createDocument(None, "doc", None)
1.5 top = document.xpath("*")[0]
1.6 elem1 = document.createElementNS("DAV:", "href")
1.7 +print "Namespace is", repr(elem1.namespaceURI)
1.8 document.replaceChild(elem1, top)
1.9 elem2 = document.createElementNS(None, "no_ns")
1.10 +print "Namespace is", repr(elem2.namespaceURI)
1.11 document.xpath("*")[0].appendChild(elem2)
1.12 print document.toString()
1.13 document.toFile(open("test_ns.xml", "wb"))
1.14 @@ -16,8 +18,10 @@
1.15
1.16 document = xml.dom.minidom.Document()
1.17 elem1 = document.createElementNS("DAV:", "href")
1.18 +print "Namespace is", repr(elem1.namespaceURI)
1.19 document.appendChild(elem1)
1.20 elem2 = document.createElementNS(None, "no_ns")
1.21 +print "Namespace is", repr(elem2.namespaceURI)
1.22 document.childNodes[0].appendChild(elem2)
1.23 print document.toxml()
1.24 open("test_ns.xml", "wb").write(document.toxml())