character-map

Here should go questions about transforming XML with XSLT and FOP.
ian
Posts: 5

character-map

Mon May 23, 2005 6:10 pm

Hello,

I need to create files from a multilanguage xml source file with some accented characters and I'm getting the following error message:

"Cannot use character maps in an environment with no Controller"

Can anybody explain this error to me ? Is it an error generated by the Saxon processor (I'm using Saxon8B) or by <oXygen/> ?

The full stylesheet is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [
<!ENTITY tab "<xsl:text>&#9;</xsl:text>">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="text" encoding="UTF-8" indent="no" use-character-maps="mymap"/>
<xsl:character-map name="mymap">
<xsl:output-character character="é" string="&#142;"/>
<xsl:output-character character="à" string="&#136;"/>
</xsl:character-map>
<xsl:template match="/">
<xsl:for-each select="//article">
<xsl:variable name="ref" select="Reference"/>
<xsl:variable name="filename" select="concat('pmm/',$ref,'.txt')"/>
<xsl:result-document href="{$filename}">&lt;@Title&gt;&lt;a$$&gt;<xsl:value-of select="DescriptionFR"/>&lt;@$&gt;
<xsl:text>&#013;</xsl:text>
<xsl:value-of select="TailleFR"/>&tab;
<xsl:value-of select="Reference"/>&tab;
<xsl:value-of select="Prix"/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


Thanks,
Ian
bogdan
Posts: 13

character-map

Tue May 24, 2005 11:13 am

Hello,

That is a bug in the XSLT Debugger perspective and it will be solved in a future release.
As an workaround please comment all <xsl:character-map> elements in your XSLT 2.0 stylesheets when you debug them and uncomment them when doing the transformation in the Editor perspective.

Regards,
Bogdan
ian
Posts: 5

Tue May 24, 2005 7:09 pm

ok, the transformation does indeed work in the Editor perspective but the output is not correct. I'm getting some other charater before the ones defined in the character map. Like "Ž ˆ".

In fact I get the same incorrect output if I define the entities in the xml source file itself.

Any ideas ?

Thanks,

Ian
sorin_ristache
Posts: 4144

Wed May 25, 2005 11:51 am

Hello,

Maybe the character codes 142 and 136 are wrong. They are Unicode control characters. What do you expect to be displayed for them ? You need the characters é and à ? In that case the codes are 233 and 224. Otherwise please post the characters that you expect to see in the output.

Best regards,
Sorin

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest