Project

Profile

Help

translation() something wrong?

Added by Anonymous almost 19 years ago

Legacy ID: #3527140 Legacy Poster: dieter (don_pomodoro)

Hello again, I'm a little confused with the function translate(). I would like to translate german characters to ther ASCII code in order to get right data to Java VM <!-- example --> translate(@State.name,'ÄÖüäöüß','&#196;&#214;&#220;&#228;&#246;&#252;&#223;') <!--/ example --> But it doesn't work. The german characters are still in the output HTML. If I'm testing it e.g. with XYZ it works fine. <!-- example --> translate(@State.name,'ÄÖüäöüß','_') <!--/ example --> it works fine. What I'm doing wrong? Thanks a lot in advance. Dieter


Replies (2)

RE: translation() something wrong? - Added by Anonymous almost 19 years ago

Legacy ID: #3527672 Legacy Poster: Michael Kay (mhkay)

&#196; is a character reference representing the character capital A with umlaut. It's translated to that character by the XML parser, long before Saxon gets to see it. So Ä and &#196; are completely equivalent as far as the XSLT processor is concerned. (Ä is a non-ASCII character, by the way - you had me confused by referring to it as ASCII). If you want characters represented by character references, this is a job for the serialization phase, not for the transformation phase. The simplest way to achieve it is to specify encoding="us-ascii" in xsl:output. If you do this, non-ASCII characters will be represented using XML escape conventions. Michael Kay

RE: translation() something wrong? - Added by Anonymous almost 19 years ago

Legacy ID: #3528426 Legacy Poster: dieter (don_pomodoro)

Thank You very much Michael! It works fine :) Dieter

    (1-2/2)

    Please register to reply