Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.0
-
None
-
None
Description
import groovy.util.slurpersupport.NamespaceAwareHashMap import groovy.xml.XmlUtil class Test { public static void main(String[] args) { def source = ''' <test> </test> ''' def slurper = new XmlSlurper() def document = slurper.parseText(source); document << { qqq() } document << new groovy.util.slurpersupport.Node(null, "qqq", new NamespaceAwareHashMap(), [:], ""); document.children().'**'*.@mass = "!!!" println XmlUtil.serialize( document ) } }
This code provides this:
<?xml version="1.0" encoding="UTF-8"?><test> <qqq/> <qqq mass="!!!"/> </test>
But it should be:
<?xml version="1.0" encoding="UTF-8"?><test> <qqq mass="!!!"/> <qqq mass="!!!"/> </test>