cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: character-maps in cocoon
Date Tue, 10 Jun 2008 12:08:19 GMT
On 09.06.2008 06:29, Heather Rankin wrote:

> Are character-maps supported in Cocoon 2.1? I need to replace &lt; and
> &gt; entity references with the literal characters '<' and '>' and can't
> get it to work in Cocoon. I have the following character-map in my XSLT:
> 
> <xsl:output use-character-maps="cm1" method="xml" indent="yes"
> encoding="UTF-8" media-type="text/xml"/>
> 	
> <xsl:character-map name="cm1">
> 	<xsl:output-character character="&lt;" string="&lt;"/>
> 	<xsl:output-character character="&gt;" string="&gt;"/>
> </xsl:character-map>
> 
> This works fine outside of cocoon (e.g. in Oxygen). But when I run it
> through the second transformer in the following pipleline:
> 
> <map:match pattern="terms">
> 	<map:generate src="{request-param:url}" type="html"/>
> 	<map:transform type="xslt2" src="transforms/getTerms.xsl"/>
> 	<map:transform type="xslt2"
> src="transforms/convertStringToXML.xsl"/>
> 	<map:serialize type="xml"/>
> </map:match>
> 
> ... the &lt; and &gt; characters do not get replaced (remain escaped).
> Is this something to do with the xml serializer? Do I need to change
> something there?

disable-output-escaping (and it seems also charater-map) only passes 
serializer hints along with the actual XML. With a second transformation 
following the one using disable-output-escaping these hints get lost. 
That's why you should not use this "feature" in Cocoon. It only works in 
a non-streaming environment, where you serialize after each transformation.

Joerg

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


Mime
View raw message