Q:

using groovyxmlslurper from EL in JSP

I've been tasked with creating a JSP tag that will allow developers to pass a URI to an xml document, and have an object returned that can be navigated using EL.
I have been using groovy and grails quite a bit so I thought of trying something like
rval =  new XmlSlurper().parseText(myXml);

and throwing that into the request so that back in the JSP they might do something like:
<mytag var="var"/>
${var.rss[0].title} 

but that approach doesn't work. 
Does anyone have any suggestions?

A:

Gizmo is correct that the problem is that JSPs assume everything is Java, but I doubt that switching to GSP is a practical answer. To work around this, you need to know how Groovy code gets translated to Java. The Groovy code:
var.rss[0].title

Is roughly equivalent to this Java:
var.getProperty("rss").getAt(0).getProperty("title")

It may also be necessary to cast each result to a GPathResult, e.g.,
((GPathResult)((GPathResult)var.getProperty("rss")).getAt(0)).getProperty("title")

Java sucks, huh?

