[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: encoding problem

Subject: RE: encoding problem
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 12 Apr 2004 22:33:00 +0100
html combobox
There's a problem in the specs here. The href attribute is required to be a
legal URI Reference, and to ensure this, the XSLT serialization spec
requires that the "_" is encoded as %C3%9F. But no similar encoding is
applied to the name or id attribute of the anchor (and it would be illegal,
at least in XHTML, because % is not allowed in an NCName); and some browsers
at least won't match a %C3%9F in the fragment identifier of the href URI to
a "_" in the name attribute.

I think what this means in practice is that it's unsafe to use non-ASCII
characters in the names of HTML anchors.

Michael Kay

> -----Original Message-----
> From: Daniel Purucker [mailto:dpu@xxxxxxxxxxxxxxxxxx] 
> Sent: 12 April 2004 13:17
> To: xsl-list mulberry
> Subject:  encoding problem
> 
> Hi,
> 
> i think i've got a kind of encoding problem. Hope somebody can help 
> me...
> I'm creating an html-combobox through xslt, for navigating the output 
> html-file.
> The user chooses a value, clicks the button and jumps to the anchor. 
> Everything works fine, until the value includes an "_" (as seen eg in 
> the german: gro_britannien)
> 
> This is the code, which creates the link in the combo-box
> 
> <xsl:element name="option">
> <xsl:attribute name="value">
> <xsl:text>#</xsl:text><xsl:value-of select="."/></xsl:attribute>
> <xsl:value-of select="."/>
> 
> The HTML-Output is eg: #Gro_britannien
> 
> And this code produces the anchor-tag. Here the HTML-Output is a 
> different one. In this case it's HTML-Output is: #Gro%C3%9Fbritannien
> So it's obvious the link from above doesn't find a corresponding 
> anchor...
> 
> <a>
> <xsl:attribute name="name">
> <xsl:value-of select="./text()"/>
> </xsl:attribute>
> <xsl:attribute name="class">Modellstyle</xsl:attribute>
> <xsl:value-of select="./text()"/>
> </a>
> 
> 
> 
> Any ideas? Thanx in advance, Daniel

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.