cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dingjun Jia" <dingjun....@gmail.com>
Subject AW: How to avoid the encoded text &#220 in pdf generation
Date Tue, 11 Jul 2006 19:07:37 GMT
I have this in my sitemap:

1. <map:match pattern="test.pdf">
2. <map:generate src="test/test.xsp" type="serverpages"/>
3. <map:transform src="test/pdf.xsl" type="xslt" /> <!-- in this xsl file I
habe used disable-output-escaping="yes" -->
4. <map:serialize type="fo2pdf"/>
5. </map:match> 

In the pdf.xsl (in the 4. row) i have used disable-output-escaping="yes" and
in the generated fo file i saw only &#220; not the &amp;#220; . In the
database there is &#220;, but the xsp page generate default &amp;#220;, i
don't how to teak it to just output &#220. I have tested your second
solution, unfortunately, it doesn't work. 

-----Urspr√ľngliche Nachricht-----
Von: Toby [mailto:tobia.conforto@linux.it] 
Gesendet: Dienstag, 11. Juli 2006 15:43
An: users@cocoon.apache.org
Betreff: Re: How to avoid the encoded text &#220 in pdf generation

Dingjun Jia wrote:
> <?xml version="1.0" encoding="UTF-8"?> <doc>
>       <text>&amp;#220;bung</text>
> </doc>

This won't work.  It should read &#220; instead of &amp;#220;

You have 2 options.  The right one: understand what generates it that way
and fix the problem earlier in the pipeline; or the quick one: give it a run
of disable-output-escaping, using an xsl transformer just before
serialization, with a stylesheet like this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="@*">
    <xsl:attribute name="{name()}">
      <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:attribute>
  </xsl:template>
  <xsl:template match="text()">
    <xsl:value-of select="." disable-output-escaping="yes"/>
  </xsl:template>
  <xsl:template match="node()" priority="-1">
    <xsl:copy><xsl:apply-templates select="node()"/></xsl:copy>
  </xsl:template>
</xsl:stylesheet>

(adjust to your needs)


Toby

---------------------------------------------------------------------
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


Mime
View raw message