xsl-list
[Top] [All Lists]

AW: [xsl] output encoding character map

2012-08-03 03:41:20
Thank you for your very detailed answer. 
I have now found the problem. 
My entries looked like this:

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

When I changed them to this:

<xsl:output-character character="ä" 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(_dot_)szabo(_at_)lexisnexis(_dot_)at
Tel.: +43 1 53452 1573 
Fax: +43 1 534 52 146 


-----Ursprüngliche Nachricht-----

Von: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Gesendet: Freitag, 03. August 2012 10:28
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: Re: [xsl] output encoding character map


As Chris Maden says, ä  is not x201e. I think you can assume that x201e 
is the character at fault, and that ä 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 ä (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="ä" 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(_dot_)szabo(_at_)lexisnexis(_dot_)at
Tel.: +43 1 53452 1573
Fax: +43 1 534 52 146






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


<Prev in Thread] Current Thread [Next in Thread>