Re: [xslt] libxslt escaping urls when outputting HTML



On Fri, Sep 06, 2002 at 03:58:38PM +1000, Andy Hird wrote:
[...]
> and with version 1.18 (and version 1.20 I just tested) we get:
> 
> <a href="http://foobar.com/hello%2Cworld";>test</a>
> 
> 
> I know that they are, in essence, the same thing but unfortunately we
> have some software relying on the former output (which we will fix). 
> 
> I was curious what prompted the change in libxslt and whether there was
> a way (within the xslt) of changing that escaping for the whole document
> (rather than using xsl:text elements with escape exceptions).

  The reason is simple: standard conformance
    http://www.w3.org/TR/xslt#section-HTML-Output-Method

    "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."

 RFC 2396 section 2.2. defines "," as being in the reserved character
set which need escaping when the character may influence the semantic of
the URI if not escaped. In the case of "," maybe this should not be escaped
when present in the path section of the URI, that can be debated and possibly
changed in libxml2 (i.e. I could be relatively easilly convince to change
this :-) but it's always difficult to estimate the consequences of such
changes).

 However considering the complexity of the issue, maybe it's a good thing 
to not rely on the former output anyway, and there isn't a way to avoid the
escaping (even the xsl:text trick won't work in that case, the URI serializer
won't look at this, the escaping disabling wasn't intended for this).

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]