character-map

Here should go questions about transforming XML with XSLT and FOP.
ian
Posts: 5
Joined: Fri Mar 25, 2005 2:04 pm

character-map

Post by ian »

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}"><@Title><a$$><xsl:value-of select="DescriptionFR"/><@$>
<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
Joined: Tue Jan 14, 2003 12:22 pm

character-map

Post by bogdan »

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
Joined: Fri Mar 25, 2005 2:04 pm

Post by ian »

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: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

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