2

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.

4

1 に答える 1

2

xmlファイルをレンダリングしたいだけの場合は、次のように言うことができます。

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

そして、スラーパーはまったく必要ありません

于 2010-01-14T15:35:15.003 に答える