Lines 259-264
Link Here
|
259 |
</xsl:call-template> |
259 |
</xsl:call-template> |
260 |
</span> |
260 |
</span> |
261 |
</xsl:template> |
261 |
</xsl:template> |
|
|
262 |
|
263 |
<xsl:variable name="ascii"> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:variable> |
264 |
<xsl:variable name="latin1"> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:variable> |
265 |
|
266 |
<!-- Characters that usually don't need to be escaped --> |
267 |
<xsl:variable name="safe">!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:variable> |
268 |
|
269 |
<xsl:variable name="hex" >0123456789ABCDEF</xsl:variable> |
270 |
<xsl:template name="url-encode"> |
271 |
<xsl:param name="str"/> |
272 |
<xsl:if test="$str"> |
273 |
<xsl:variable name="first-char" select="substring($str,1,1)"/> |
274 |
<xsl:choose> |
275 |
<xsl:when test="contains($safe,$first-char)"> |
276 |
<xsl:value-of select="$first-char"/> |
277 |
</xsl:when> |
278 |
<xsl:otherwise> |
279 |
<xsl:variable name="codepoint"> |
280 |
<xsl:choose> |
281 |
<xsl:when test="contains($ascii,$first-char)"> |
282 |
<xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/> |
283 |
</xsl:when> |
284 |
<xsl:when test="contains($latin1,$first-char)"> |
285 |
<xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/> |
286 |
</xsl:when> |
287 |
<xsl:otherwise> |
288 |
<xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message> |
289 |
<xsl:text>63</xsl:text> |
290 |
</xsl:otherwise> |
291 |
</xsl:choose> |
292 |
</xsl:variable> |
293 |
<xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/> |
294 |
<xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/> |
295 |
<xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/> |
296 |
</xsl:otherwise> |
297 |
</xsl:choose> |
298 |
<xsl:if test="string-length($str) > 1"> |
299 |
<xsl:call-template name="url-encode"> |
300 |
<xsl:with-param name="str" select="substring($str,2)"/> |
301 |
</xsl:call-template> |
302 |
</xsl:if> |
303 |
</xsl:if> |
304 |
</xsl:template> |
305 |
|
262 |
</xsl:stylesheet> |
306 |
</xsl:stylesheet> |
263 |
|
307 |
|
264 |
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. |
308 |
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. |
265 |
- |
|
|