# HG changeset patch # User paulb # Date 1134348563 0 # Node ID 423bfb7630b41132b97a54391337bbc7214afcf9 # Parent 0e5255804e5e9524a4ee4c51ff603909de55d884 [project @ 2005-12-12 00:49:23 by paulb] Added more xmlns attributes in namespaces2. Added a namespaces3 test of multiply-defined attributes. diff -r 0e5255804e5e -r 423bfb7630b4 tests/namespaces2.py --- a/tests/namespaces2.py Mon Dec 12 00:48:54 2005 +0000 +++ b/tests/namespaces2.py Mon Dec 12 00:49:23 2005 +0000 @@ -6,13 +6,15 @@ top = document.xpath("*")[0] elem1 = document.createElementNS("DAV:", "myns:href") elem1.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns:myns", "DAV:") +elem1.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns:otherns", "urn") document.replaceChild(elem1, top) print document.toString() -document = xml.dom.minidom.Document() -elem1 = document.createElementNS("DAV:", "myns:href") +document2 = xml.dom.minidom.Document() +elem1 = document2.createElementNS("DAV:", "myns:href") elem1.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns:myns", "DAV:") -document.appendChild(elem1) -print document.toxml() +elem1.setAttributeNS(xml.dom.XMLNS_NAMESPACE, "xmlns:otherns", "urn") +document2.appendChild(elem1) +print document2.toxml() # vim: tabstop=4 expandtab shiftwidth=4 diff -r 0e5255804e5e -r 423bfb7630b4 tests/namespaces3.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/namespaces3.py Mon Dec 12 00:49:23 2005 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import libxml2dom + +document = libxml2dom.createDocument(None, "doc", None) +e = document.xpath("*")[0] +e.setAttributeNS("xxx", "yyy", "zzz") +e.setAttributeNS("xxx", "yyy", "zzz") +e.setAttributeNS("xxx", "x:yyy", "zzz") +e.setAttributeNS("xxx", "x:yyy", "zzz") +print document.toString() + +# vim: tabstop=4 expandtab shiftwidth=4