Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.7, 1.6-beta-2
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: XML Processing
-
Labels:None
-
Environment:Windows XP, Java 1.6.0_06
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
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.
Activity
blackdrag blackdrag
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Paul King [ paulk ] |
Paul King
made changes -
| Affects Version/s | 1.5.7 [ 14242 ] | |
| Affects Version/s | 1.6-beta-2 [ 14261 ] | |
| Component/s | XML Processing [ 12201 ] |
Paul King
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 1.5.8 [ 14630 ] | |
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | 1.6-rc-1 [ 14009 ] | |
| Fix Version/s | 1.7-beta-1 [ 14014 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Hi. Thanks for the patch - looking at it now. Just for future reference, patches against trunk are generally greatly preferred over complete source files. But I guess a file is preferred over nothing!