Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.4
-
None
Description
As per the mailing list:
import groovy.xml.StreamingMarkupBuilder doc = """<Field Text="<html>Some Text</html>" />""" def d = new XmlParser().parseText(doc) def writer = new StringWriter() new XmlNodePrinter(new PrintWriter(writer)).print(d) def result = writer.toString() println result d = new XmlSlurper().parseText(doc) writer = new StringWriter() writer << new StreamingMarkupBuilder().bind {out << d} result = writer.toString() println result
produces:
<Field Text="<html>Some Text</html>"/> <Field Text='<html>Some Text</html>'></Field>