rendered paste body<?xml version="1.0"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:call-template name="quote-uri"> <xsl:with-param name="uri" select=" 'http://www.example.org/boy?socks=black&eyes=blye&hair=long&age=19' " /> </xsl:call-template> </xsl:template> <!--* quote ampersand, less-than and greater-than in a URI; this is * not a full URI quoting, and does not hande IRIs. *--> <xsl:template name="quote-uri"> <xsl:param name="uri" /> <xsl:variable name="firstchar" select="substring($uri, 1, 1)" /> <xsl:choose> <xsl:when test="$firstchar = ''"></xsl:when> <!--* finished *--> <xsl:when test="$firstchar = '<'"> <xsl:text>%3c</xsl:text> <xsl:call-template name="quote-uri"> <xsl:with-param name="uri" select="substring($uri, 2)" /> </xsl:call-template> </xsl:when> <xsl:when test="$firstchar = '>'"> <xsl:text>%3e</xsl:text> <xsl:call-template name="quote-uri"> <xsl:with-param name="uri" select="substring($uri, 2)" /> </xsl:call-template> </xsl:when> <xsl:when test="$firstchar = '&'"> <xsl:text>%26</xsl:text> <xsl:call-template name="quote-uri"> <xsl:with-param name="uri" select="substring($uri, 2)" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$firstchar" /> <xsl:call-template name="quote-uri"> <xsl:with-param name="uri" select="substring($uri, 2)" /> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template></xsl:stylesheet>