[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: output encoding character map

Subject: AW: output encoding character map
From: "Szabo, Patrick \(LNG-VIE\)" <patrick.szabo@xxxxxxxxxxxxx>
Date: Fri, 3 Aug 2012 10:40:58 +0200
AW:  output encoding character map
Thank you for your very detailed answer.
I have now found the problem.
My entries looked like this:

<xsl:output-character character="C$" string="&#228;"/>

When I changed them to this:

<xsl:output-character character="C$" string="&amp;#228;"/>

it worked.
You are right I am writing CDATA Sections, and I'm using
disable-output-escaping but the text that is outputted there doesn't contain
any chars outside my chosen encoding.

Now since you said Saxon should replace the chars even without a character-map
I ran the transformation without the map and it works as well...now I'm
confused.

regards



. . . . . . . . . . . . . . . . . . . . . . . . . .
Developer Patrick Szabo
 Developer
LexisNexis
A-1030 Wien, Marxergasse 25

mailto:patrick.szabo@xxxxxxxxxxxxx
Tel.: +43 1 53452 1573
Fax: +43 1 534 52 146


-----UrsprC<ngliche Nachricht-----

Von: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Gesendet: Freitag, 03. August 2012 10:28
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: Re:  output encoding character map


As Chris Maden says, C$  is not x201e. I think you can assume that x201e
is the character at fault, and that C$ is an incorrect attempt to render
it (if it's console output, then in my experience console output does
some strange things with non-ASCII characters, though it no doubt
depends on various configuration settings, not to mention your choice of
operating system).

You shouldn't need a character map to translate characters that aren't
present in the chosen encoding to their numeric &-escaped form; Saxon
should do this automatically for characters in text or attribute nodes.
If the character is outside a text or attribute node (for example in an
element name or in a comment), then character maps won't help you
anyway, because they aren't used in those contexts.

Looking at the Saxon code, this error message is produced only when
output escaping is disabled. This could be because you explicitly set
disable-output-escaping in your source, or because Saxon has disabled
output escaping internally, which it does for example when writing a
CDATA section.

The spec says this:

Character mapping is not applied to characters for which output escaping
has been disabled.

Could it be the case that your stylesheet uses disable-output-escaping
as well as character maps?

The spec also says this:

If output escaping is disabled for a character that is not representable
in the encoding that the processor is using for output, the request to
disable output escaping is ignored in respect of that character.

but I'm not sure I can find any code in Saxon that implements that rule.
And it's not clear whether ignoring the request to disable output
escaping means that the character map should then kick in under the
previously-cited rule...

Michael Kay
Saxonica

On 03/08/2012 07:16, Szabo, Patrick (LNG-VIE) wrote:
> Hi,
>
> I'm using xslt 2.0 and saxon 9.
> While transforming I get the following error:
>
> SERE0008: Character C$ (x201e) is not available in the chosen encoding
>
> That would not be too surprising to me if I wasn't already using a character
map that is supposed to translate that char into a hex representation:
>
> <xsl:output-character character="C$" string="&amp;#228;"/>
>
> The character map seems to work for all the other chars.
>
> Any ideas ?
>
> regards
>
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Developer Patrick Szabo
>   Developer
> LexisNexis
> A-1030 Wien, Marxergasse 25
>
> mailto:patrick.szabo@xxxxxxxxxxxxx
> Tel.: +43 1 53452 1573
> Fax: +43 1 534 52 146

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.