Ian Walsh | 5 Sep 11:25

[groovy-user] Unescaped Streaming MarkupBulder output from a GPathResult

Hi, hoping someone out there can help me with a problem I’ve got getting unescaped output from StreamingDocumentWriter…. The problem is as follows:

 

I use XmlSlurper to process an xhtml file containing a typical mixture of javascript (surrounded by <script> tags) and other valid xml markup, which gives me a GPathResult that I can then happily process.

 

I then want to output the final document so use bind{mkp.yield(gpath)} on a StreamingMarkupBuilder instance. This causes the javascript to be escaped, eg, if(x < y) becomes if(x &lt; y) which is then not able to be run by a javascript processor.

 

I tried bind{mkp.yieldUnescaped(gpath)} instead, but this gives me the xml text, but all tags are missing.

 

Is there a different way of outputting my GPathResult that I should be using?

 

(Groovy 1.5.6)


Gmane