[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] i18n problem while displaying using stylesheet


Subject: RE: [xsl] i18n problem while displaying using stylesheet
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Fri, 25 Jun 2004 10:34:17 -0400

> From: Ranjan K. Baisak [mailto:ranjanbaisak@xxxxxxxxx] 
>           My xml contains following elements with japanese 
> characters. 
> <country
> name="&#20837;&#21147;&#26989;&#21209;&#24037;&#25968;&#12398;
> &#21066;&#38500;"
> nameindex="1" />
> <country
> name="&#20837;&#21147;&#26989;&#24037;&#25968;&#12398;&#21066;
> &#38500;"
> nameindex="2" />
> I need to display japanese charachers as it is. My stylesheet 
> displays acsii characters not japanese characters when it 
> converts xml to html.

It is not the stylesheet that displays the characters.  It is your
browser or editor or other application that handles the display.  To
display as intended, the encoding has to be correct and the application
has to have the right font available.

As a test, I modified your xml file to use elements only, like this -

<data>
<country>&#20837;&#21147;&#26989;&#21209;&#24037;&#25968;&#12398;&#21066
;&#38500;</country>
<country>&#20837;&#21147;&#26989;&#24037;&#25968;&#12398;&#21066;&#38500
;</country>
</data>

Then I opened this file in my Firefox browser, running on Windows2000.
The japanese characters displayed as japanese characters.  This verifies
that my system is able to display them correctly.  The xslt processor
may change the character references to the corresponding actual
characters, but that will not affect the display in a browser.  You can
verify that easily by running a simple identity transformation.

You have not shown us (a simplified version of) your stylesheet, but
perhaps it declares an inappropriate encoding for the output.
Alternatively, if you are working in a development editor that displays
the results of the transformation, it may not be able to display the
characters properly.  This is the case for XML Cooktop (at last, for the
older version).

Your problem is very likely one of these two alternatives.  Most likely
it is simply the application you are using for display.

Cheers,

Tom P


Current Thread
Keywords