cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Didier VILLEVALOIS <dvilleval...@techmetrix.net>
Subject RE: Output escaping
Date Tue, 06 Jun 2000 14:19:28 GMT
Hi Echoes,

This is because of the XSPPage.xspExpr() which try to use the content of
your xsp:expr as it was returning: (cf XSPPage.java line 136-168)
1) a DOM node
2) an array (recursively call xspExpr())
3) convertible to node (i.e. an XNode)
and finaly 4) converts it to a string and creates a text node of it.

The last case is the one that apply to you. As text nodes can't contain <
and >, Document.createTextNode() converts them to &lg; and &lt;.

Your toXML() method should build a dom tree instead of an xml String. And
this would work great !! :-)

Didier

> -----Message d'origine-----
> De: Echoes [mailto:echoes@free.fr]
> Date: mardi 6 juin 2000 16:01
> À: cocoon
> Objet: Output escaping
> 
> 
>   Hello,
> 
>  I'm using a java package inside an xsp page.
> A class in the package has a method to ouput 
> an XML stream describing the object. It looks
> like :
> 
>  <object>
>     <property1>value 1</property1>
>     <property2>value 2</property2>
>  </object>
> 
>  I'm trying to output it using <xsp:expr> :
> 
>  <xsp:content><xsp:expr>myObject.toXML()</xsp:expr></xsp:content>
> 
>  Unfortunately, <xsp:expr> converts < to &lt; and > to &gt;
> 
>  How can I circumvent this behavior ?
> 
>    Thanks
> 
> 	Fabrice
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Mime
View raw message