You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Patrick Early <pa...@hotmail.com> on 2002/06/21 16:39:29 UTC

Xalan-J problem with xsl:attribute and Japanese characters...

Hello,

I am having a problem with Xalan transforming a document containing Japanese 
characters. (An initial note: the problem does not occur on my Windows 
development machine, only on the Solaris test/production environments.)

The basic problem is that for any place I'm selecting XML node values to use 
within an xsl:attribute block, if the text is double-byte it is converted to 
the NCR representation instead of the actual characters. Under Windows, the 
"real" characters appear within the attribute tag. I'm positive the source 
XML is UTF-8 encoded, as I can output the value correctly within the same 
stylesheet as long as it is not output within an xsl:attribute tag.

Here's an XSL snippet--the basic idea is I'm creating a bunch of HTML fields 
and setting the "value" attribute to a selected XML element value:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" omit-xml-declaration="yes" method="html"/>
.........

<xsl:template match="//root/row">

    <tr>
        THIS VALUE IS KANJI AND GETS OUPUT AS NCR

        <td width="400" class="label" height="18">
            <input type="text" name="companyAffiliation" size="50">
                <xsl:attribute name="value">
                    <xsl:value-of select="companyAffiliation"/>
                </xsl:attribute>
            </input>
        </td>
    </tr>

    <tr>
        USING A TEXTAREA WITHOUT XSL:ATTRIBUTE, IT OUTPUTS CORRECTLY

        <td width="400" class="label" height="18">
            <textarea name="companyAffiliation2" rows="1" cols="50">
                <xsl:value-of select="companyAffiliation"/>
            </textarea>
        </td>
    </tr>

</xsl:template>

I'm using the latest version of Xerces/Xalan w/JDK 1.2.2. Once again, it
works fine on Windows. Any ideas?

Thanks,

- patrick

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx