This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Special characters turn out as garbage in xslt->html conversion
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Special characters turn out as garbage in xslt->html conversion
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Fri, 8 Sep 2000 11:56:23 +0100
- Reply-To: xsl-list at mulberrytech dot com
> That is, the second loop gives this (for an A with
> acute accent):
>
> <a name="Á">Á</a>
>
> just like it should. If however the html-attribute is "href"
> the output is
> like this in html:
>
> <a href="#%C3%81">Á</a>
>
> I have absolutely no idea why this happens and haven't been
> able to find any clues.
The clue is the paragraph in XSLT section 16.2 that says: "The html output
method should output non-ASCII characters in URI attribute values using the
method recommended in section B.2.1 of the HTML 4.0 Recommendation".
Technically, non-ASCII characters in URIs are illegal.
The "garbage" is actually the hex representation of the UTF-8 encoding of
the relevant characters.
Don't worry about the HTML, so long as it works in your browser!
I think the <a name=""> attribute should also be escaped this way even
though its value is not a URI, this is a minor omission from the XSLT spec.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list