URL encoding (why + and not %20?)
To achieve the encoding I'm using a built-in Java function available in an extension to the XSLT Processor (Xalan) as below:-
<?xml version="1.0" encoding="UFT-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common"
xmlns:encoder="xalan://java.net.URLEncoder">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
and later in my template
/preview.xml?name=<xsl:value-of select="encoder:encode(string(title_node))"/>
The problem is, it's encoding spaces as '+' and not '%20' which I was expecting (and need).
Has anyone tried this before and does anyone think it can be fixed with the encoding?
Any advice appreciated
|