Hi all. I am really stuck here. I am creating an XML document with Groovy 1.7 and everything is working except one section is being escaped when it shouldn't.
I am starting out like this:
triadDoc = new XmlSlurper().parse(xmlTriadMessageDocumentPath)
writer = new StringWriter()
xmlBuilder = new StreamingMarkupBuilder()
writer = xmlBuilder.bind {mkp.yield triadDoc}
which works great. Then I'm adding to the document like this:
triadDoc.TriadPayload.Payload[0] = "<![CDATA[" + xmlBuilder.bind {mkp.yieldUnescaped dto.getCcdDoc()} + "]]>"
This does not work as I want - I end up with this:
& lt;![CDATA[& lt;ClinicalDocument& gt;... (added extra blank to the escape sequences)
Can anyone tell me what I'm doing wrong? I've looked all over the Internet for a clue. Thanks!!