views:

247

answers:

2

Hello, I'm having problems rendering an XML file parsed via XMLSlurper to an XML variable. Below is my code.

def userFile =new File("test.xml") def xml= new XmlSlurper().parse(userFile)

render xml

The problem is I cannot see the xml being rendered into my flex app.

+1  A: 

If you just want to render the xml file you can say:

    def xmlFile = new File("test.xml")
    response.contentType = "text/xml"
    response.outputStream << xmlFile.text

And there's no need for the slurper at all

Dave
A: 

Thanks you very much..now my problem is getting the response.outputSteam in flex. It seems that the resultEvent.result is not of xml format.

Thanks!

Anthony Umpad