[xslt] libxslt escaping urls when outputting HTML



Hi all, I suspect this question has been asked before but having looked
through the archives and bug db I couldn't find anything to help so here
goes...

I've been using libxslt for a while under Debian Linux for a while but
have seen a change in behaviour in libxslt since the latest version came
out (it involved an upgrade of libxslt from 1.16 -> 1.18).

When the output method is set to html any commas in URLs are escaped (to
%2C). 

eg. Got a stylesheet:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
		<a href="http://foobar.com/hello,world";>test</a>
</xsl:template>
</xsl:stylesheet>

And an XML file:

<?xml version="1.0"?> 
<doc/>

Running xsltproc with no options in version 1.16 we got the output:

<a href="http://foobar.com/hello,world";>test</a>

(i.e. Comma between the hello and world)

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

Thanks
Andy Hird





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