<xsl:param name="annotations" select="'no'"/>
<xsl:param name="media-type" select="'text/html'"/>
<xsl:param name="doctype-public" select="'-//W3C//DTD XHTML 1.0 Transitional//EN'"/>
-<xsl:param name="encoding" select="iso-8859-1"/>
+<xsl:param name="encoding" select="'iso-8859-1'"/>
<xsl:variable name="absPath"><xsl:value-of select="$getterURL"/>getxml?uri=</xsl:variable>
<xsl:otherwise>
<xsl:variable name="char" select="substring($s,1,1)"/>
<xsl:choose>
- <xsl:when test="$char != ' '">
+ <xsl:when test="$char = ' '">
<xsl:call-template name="quote">
<xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,$char)"/>
+ <xsl:with-param name="news" select="concat($news,'%20')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$char = '&'">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,'%26')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="quote">
<xsl:with-param name="s" select="substring($s,2)"/>
- <xsl:with-param name="news" select="concat($news,'%20')"/>
+ <xsl:with-param name="news" select="concat($news,$char)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:call-template>
</xsl:variable>
+<xsl:variable name="escaped-processorURL">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$processorURL"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<xsl:variable name="escaped-getterURL">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="$getterURL"/>
+ </xsl:call-template>
+</xsl:variable>
+
<!-- makeURL() maps URIs into URLs -->
<xsl:variable name="header1"><xsl:value-of select="$processorURL"/>apply?keys=</xsl:variable>
-<xsl:variable name="header2">&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.media-type=<xsl:value-of select="$media-type"/>&param.media-type=<xsl:value-of select="$media-type"/>&prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&prop.encoding=<xsl:value-of select="$encoding"/>&param.encoding=<xsl:value-of select="$encoding"/>&param.keys=<xsl:value-of select="$keys"/>&param.getterURL=<xsl:value-of select="$getterURL"/>&param.processorURL=<xsl:value-of select="$processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
+<xsl:variable name="header2">&param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&param.annotations=<xsl:value-of select="$annotations"/>&prop.media-type=<xsl:value-of select="$media-type"/>&param.media-type=<xsl:value-of select="$media-type"/>&prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&prop.encoding=<xsl:value-of select="$encoding"/>&param.encoding=<xsl:value-of select="$encoding"/>&param.keys=<xsl:value-of select="$keys"/>&param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
<xsl:template name="makeURL">
<xsl:param name="uri" select="''"/>