Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.7, 1.6-beta-2
-
None
-
Windows XP, Java 1.6.0_06
-
Patch
Description
The following script fails, because XmlNodePrinter ignores the attribute namespace. The output of writer.toString() is <root
{www.foo.bar}type="foo"/>
def attributeWithNamespaceInput = "<root ns1:type=\"foo\" xmlns:ns1=\"www.foo.bar\"/>\n"
def root = new XmlParser().parseText(attributeWithNamespaceInput)
def writer = new StringWriter()
new XmlNodePrinter(new PrintWriter(writer)).print(root)
assert writer.toString() == attributeWithNamespaceInput
I attached a fix for XmlNodePrinter and updated the corresponding test class.