You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Hohmann <mi...@gmx.de> on 2003/10/11 12:56:12 UTC

xsp: returning nodes

Hi all,

I want an xml-structure that is returned by a function as String to be
maintained as xml and not to be treated as text.
I tried it like this:

<xsp:logic>
String noder(void)
{Return("<test>testvalue</test>");}
</xsp:logic>

<xsp:page>
<xsp:expr>noder()</xsp:expr>
</xsp:page>

The node should appear as node in the resulting xml from the logicsheet,
so a stylesheet would be able to transform it later in the pipeline.
I expected the reply from the logicsheet in the browser to look like:

<xml>
<test>testvalue</test>

But what happens is that the thing returns things like:

<xml>
&lt;test&gt;testvalue&lt;/test&gt;

Can anyone help?

Thanks....

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: xsp: returning nodes

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
If you have the control of the function, then you can use:

org.w3c.dom.DocumentFragment

Info about this interface you can find here:

http://xml.apache.org/xerces-j/apiDocs/org/w3c/dom/DocumentFragment.html

I would help if you can explain more about what are you trying to do.

Best Regards,

Antonio Gallardo.

Michael Hohmann dijo:
> Hi all,
>
> I want an xml-structure that is returned by a function as String to be
> maintained as xml and not to be treated as text.
> I tried it like this:
>
> <xsp:logic>
> String noder(void)
> {Return("<test>testvalue</test>");}
> </xsp:logic>
>
> <xsp:page>
> <xsp:expr>noder()</xsp:expr>
> </xsp:page>
>
> The node should appear as node in the resulting xml from the logicsheet,
> so a stylesheet would be able to transform it later in the pipeline. I
> expected the reply from the logicsheet in the browser to look like:
>
> <xml>
> <test>testvalue</test>
>
> But what happens is that the thing returns things like:
>
> <xml>
> &lt;test&gt;testvalue&lt;/test&gt;
>
> Can anyone help?
>
> Thanks....
>
> Michael
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org