Commit 60bc730a authored by Guido van Rossum's avatar Guido van Rossum

Take care of XML namespace for element tag

parent c6594026
......@@ -111,14 +111,16 @@ class CopyingDOMVisitor(DOMVisitor):
self.curNode = self.curNode.parentNode
def copyElement(self, node):
namespaceURI = node.namespaceURI
if self.newDocument is None:
# This must be the documentElement node. Create the
# document now; this also creates the documentElement node
self.newDocument = self.documentFactory.createDocument(
None, node.nodeName, None)
namespaceURI, node.nodeName, None)
newNode = self.newDocument.documentElement
else:
newNode = self.newDocument.createElement(node.nodeName)
newNode = self.newDocument.createElementNS(namespaceURI,
node.nodeName)
self.curNode.appendChild(newNode)
self.curNode = newNode
......
<?xml version="1.0" ?>
<biztalk_1>
<biztalk_1 xmlns="urn:schemas-biztalk-org:biztalk:biztalk_1">
<header plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<foo:header xmlns:foo="whomping-willow" plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<manifest>
<document>
<name>sample1</name>
<description>a simple invoice</description>
</document>
</manifest>
</header>
</foo:header>
<body>
<!-- sample1.xml is an example of a simple invoice for a small restaurant supplies order -->
<Invoice>
<Invoice xmlns="urn:http://schemas.biztalk.org/united_rest_com/yw7sg15x.xml">
<Header>
<InvoiceNumber>01786</InvoiceNumber>
<InvoiceDate>2000-03-17</InvoiceDate> <!-- March 17th, 2000 -->
......
<?xml version="1.0" ?>
<biztalk_1 xmlns="urn:schemas-biztalk-org:biztalk:biztalk_1">
<header plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<foo:header xmlns:foo="whomping-willow" plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<manifest>
<document>
<name>sample1</name>
<description>a simple invoice</description>
</document>
</manifest>
</header>
</foo:header>
<body>
......
<?xml version="1.0" ?>
<biztalk_1>
<biztalk_1 xmlns="urn:schemas-biztalk-org:biztalk:biztalk_1">
<header plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<foo:header xmlns:foo="whomping-willow" plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<manifest>
<document>
<name>sample1</name>
<description>a simple invoice</description>
</document>
</manifest>
</header>
</foo:header>
<body>
<!-- sample1.xml is an example of a simple invoice for a small restaurant supplies order -->
<Invoice>
<Invoice xmlns="urn:http://schemas.biztalk.org/united_rest_com/yw7sg15x.xml">
<Header>
<InvoiceNumber>01786</InvoiceNumber>
<InvoiceDate>2000-03-17</InvoiceDate> <!-- March 17th, 2000 -->
......
<?xml version="1.0" ?>
<biztalk_1 xmlns="urn:schemas-biztalk-org:biztalk:biztalk_1">
<header plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<foo:header xmlns:foo="whomping-willow" plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<manifest>
<document>
<name>sample1</name>
<description>a simple invoice</description>
</document>
</manifest>
</header>
</foo:header>
<body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment