1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/namespaces2.py Sun Dec 11 17:27:40 2005 +0000
1.3 @@ -0,0 +1,18 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +import libxml2dom, xml.dom, xml.dom.minidom
1.7 +
1.8 +document = libxml2dom.createDocument(None, "doc", None)
1.9 +top = document.xpath("*")[0]
1.10 +elem1 = document.createElementNS("DAV:", "myns:href")
1.11 +elem1.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns:myns", "DAV:")
1.12 +document.replaceChild(elem1, top)
1.13 +print document.toString()
1.14 +
1.15 +document = xml.dom.minidom.Document()
1.16 +elem1 = document.createElementNS("DAV:", "myns:href")
1.17 +elem1.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns:myns", "DAV:")
1.18 +document.appendChild(elem1)
1.19 +print document.toxml()
1.20 +
1.21 +# vim: tabstop=4 expandtab shiftwidth=4