I want to print my xml which is coming from an external feed on the console.
When I do
log.debug "${xml}"
I get xml values on the console but not the starting and end tags. For example
<fruits>
<fruit1>apple</fruit1>
<fruit2>orange</fruit2>
</fruits>
Just prints appleorange
Just the values concatenated one after other. What is the best value to handle it. I tried this Best way to pretty print XML response in grails but I get exception at parseText(). I don’t know why, because I think the incoming xml is valid.
Update: The type of variable xml is Groovy’s NodeChild.
You can do the following, if your xml is simple it should satisfy your needs:
`
`