You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Frank Peters <pe...@signal7.de> on 2000/04/27 10:55:23 UTC

Encoding in attribute values

Hello.
Maybe someone can help me with this problem, cause I don't know if this is 
a bug or a feature...
System is xalan1.0.1/xerces1.03/linux

Suppose <Article> has an attribute (@headline) with text in SO-8559-2 - 
encoding

Using the following stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0">
   <xsl:output method="html"
               indent="yes"
               encoding="ISO-8559-2"/>
  <xsl:template match="Article">
     <html>
     <head>
     <meta http-equiv="content-type" content="text/html; 
charset=ISO-8559-2"/>
     </head>
     <body>
      <form>
        <input type="text" value="{@headline}"/>
        <textarea>
         <xsl:value-of select ="@headline"/>
        </textarea>
     </form>
  </xsl:template>
</xsl:stylesheet>

leads to a resulting html:
.....
<input type="text" value="&#x17b;ydzi ">
<textarea>
&#379;ydzi
</textarea>

The parser seams to treat attributes different....

I understand, that both representations are correct, but 4.x-Browsers 
cannot display the hex-representation in input fields, leading to problems 
when creating forms for different nationalities.
Is there a way to tell the parser to use the same representation in either 
case??

thanks
frank



(-) Frank Peters
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665403, Fax: 06151 665373
(-) peters@signal7.de, www.signal7.de