GNOME Bugzilla – Bug 168196
<a name=""> escaping in HTML output
Last modified: 2009-08-15 18:40:50 UTC
Applying stylesheet [code] <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" encoding="ascii"/> <xsl:template match="/"> <html> <head/> <body> <a href="ё" name="ё">ё</a> </body> </html> </xsl:template> </xsl:stylesheet> [/code] to itself, I get [result] <html> <head><meta http-equiv="Content-Type" content="text/html; charset=ascii"></head> <body><a href="%D1%91" name="ё">ё</a></body> </html> [/result] Problem is that I expect to get name="%D1%91" instead of name="ё". Reason: according to the section "16.2 HTML Output Method" of the XSLT specification, "The html output method should escape non-ASCII characters in URI attribute values using the method recommended in Section B.2.1 of the HTML 4.0 Recommendation" and the end of the Section B.2.1 in the HTML Recommendation is: Note. The same conversion based on UTF-8 should be applied to values of the name attribute for the A element.
name is an URI attribute, doesn't sounds normal to me I would expect this to be a reference for intra document linking, not an URI ? You have a pointer for me to check ? Daniel
Pointers are: http://www.w3.org/TR/xslt#section-HTML-Output-Method http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.1 The note on <a name=""> is at the end of the section B.2.1 (second link). -- > doesn't sounds normal to me Indeed, initially I also was not sure. But here is yet another example with intra-linking: [code] <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" encoding="ascii"/> <xsl:template match="/"> <html> <head/> <body> <a href="#ё">ё</a> <p>a lot of text</p> <a name="ё"/><h1>ё</h1> <p>a lot of text</p> </body> </html> </xsl:template> </xsl:stylesheet> [/code] It produces following document: [html] <html> <head><meta http-equiv="Content-Type" content="text/html; charset=ascii"></head> <body> <a href="#%D1%91">ё</a><p>a lot of text</p> <a name="ё"></a><h1>ё</h1> <p>a lot of text</p> </body> </html> [/html] Please note that "a/@name" and the URI part after "#" are different. It might confuse some HMTL applications. For example, "links" doesn't follow the link (although "mozilla" and "lynx" are ok).
Makes sense, the fix is in libxml2, but I added your test to libxslt regression tests, this is all commited in CVS. thanks a lot, Daniel
Thank you for fixing, and excuse me for late closing.