You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Sean Ferguson <se...@comcast.net> on 2003/07/18 20:54:05 UTC
[JELLY] XML Return Value
Hi,
I have a taglib that makes an http request to a server which responds
with some XML. How would I return that XML to the caller of the tag? I
tried doing this:
<x:parse var="doc">
<mytaglib:getXml id="test"/>
</x:parse>
and my taglib does this:
<http:post var="request" ... /http:post>
${request.responseBodyAsStream}
But that doesn't work. Is that what it the tag is supposed to return?
If I do responseBodyAsString, it returns the string, but all the < and >
tags are escaped out.
Please help,
Thanks!
Re: [JELLY] XML Return Value
Posted by Paul Libbrecht <pa...@activemath.org>.
Sean Ferguson wrote:
> Hi,
>
> I have a taglib that makes an http request to a server which responds
> with some XML. How would I return that XML to the caller of the tag? I
> tried doing this:
>
> <x:parse var="doc">
> <mytaglib:getXml id="test"/>
> </x:parse>
>
> and my taglib does this:
>
> <http:post var="request" ... /http:post>
> ${request.responseBodyAsStream}
>
> But that doesn't work. Is that what it the tag is supposed to return?
> If I do responseBodyAsString, it returns the string, but all the < and >
> tags are escaped out.
>
> Please help,
Sean,
That's perfectly in line... <x:parse> does not parse it's body's output...
How about using the text attribute of the x:parse ? That's exactly the
intent.
I have to say that it would be more efficient (and more philosophy
compliant to actually have a flag saying "consider body as text to be
parsed" and actually be fed not by a string but chunks of texts obtained
as a stream from your result...
Paul