0

I have the following code to get a XML page:

withHttp(uri: "PAGE") {
        get(path : 'PATH',
            query : [xxx:'xxx']){ resp, xml ->
            for (AuthToken in xml){
                println AuthToken.text()
            }
        }
     }

My problem is, that the result is not printed as a xml tree. Only the leafs of the XML document are printed. I want to print the xml document, so I can parse it with an XML Parser.

How can I achieve this?

dildik
  • 405
  • 6
  • 16

1 Answers1

0

XML which you get should already be parsed, so you don't need to parse it again. Anyway you can print xmlSlurper with nodes like that:

new StreamingMarkupBuilder().bind { out << AuthToken }
practical programmer
  • 1,604
  • 10
  • 15