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