|
Lines 1-6
Link Here
|
| 1 |
<?xml version='1.0'?> |
1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> |
2 |
<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> |
| 3 |
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc"> |
3 |
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc"> |
|
|
4 |
<!-- url encoding --> |
| 5 |
|
| 6 |
<xsl:variable name="ascii"> |
| 7 |
<xsl:text> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~</xsl:text> |
| 8 |
</xsl:variable> |
| 9 |
|
| 10 |
<xsl:variable name="latin1"> |
| 11 |
<xsl:text> ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ</xsl:text> |
| 12 |
</xsl:variable> |
| 13 |
<!-- Characters that usually don't need to be escaped --> |
| 14 |
<xsl:variable name="safe"> |
| 15 |
<xsl:text>!'()*-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~</xsl:text> |
| 16 |
</xsl:variable> |
| 17 |
|
| 18 |
<xsl:variable name="hex">0123456789ABCDEF</xsl:variable> |
| 19 |
|
| 4 |
<xsl:template name="datafield"> |
20 |
<xsl:template name="datafield"> |
| 5 |
<xsl:param name="tag"/> |
21 |
<xsl:param name="tag"/> |
| 6 |
<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> |
22 |
<xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> |
|
Lines 295-300
Link Here
|
| 295 |
|
311 |
|
| 296 |
</span> |
312 |
</span> |
| 297 |
</xsl:template> |
313 |
</xsl:template> |
|
|
314 |
|
| 315 |
<xsl:template name="url-encode"> |
| 316 |
<xsl:param name="str"/> |
| 317 |
<xsl:if test="$str"> |
| 318 |
<xsl:variable name="first-char" select="substring($str,1,1)"/> |
| 319 |
<xsl:choose> |
| 320 |
<xsl:when test="contains($safe,$first-char)"> |
| 321 |
<xsl:value-of select="$first-char"/> |
| 322 |
</xsl:when> |
| 323 |
<xsl:otherwise> |
| 324 |
<xsl:variable name="codepoint"> |
| 325 |
<xsl:choose> |
| 326 |
<xsl:when test="contains($ascii,$first-char)"> |
| 327 |
<xsl:value-of select="string-length(substring-before($ascii,$first-char)) + 32"/> |
| 328 |
</xsl:when> |
| 329 |
<xsl:when test="contains($latin1,$first-char)"> |
| 330 |
<xsl:value-of select="string-length(substring-before($latin1,$first-char)) + 160"/> |
| 331 |
<!-- was 160 --> |
| 332 |
</xsl:when> |
| 333 |
<xsl:otherwise> |
| 334 |
<xsl:message terminate="no">Warning: string contains a character that is out of range! Substituting "?".</xsl:message> |
| 335 |
<xsl:text>63</xsl:text> |
| 336 |
</xsl:otherwise> |
| 337 |
</xsl:choose> |
| 338 |
</xsl:variable> |
| 339 |
<xsl:variable name="hex-digit1" select="substring($hex,floor($codepoint div 16) + 1,1)"/> |
| 340 |
<xsl:variable name="hex-digit2" select="substring($hex,$codepoint mod 16 + 1,1)"/> |
| 341 |
<xsl:value-of select="concat('%',$hex-digit1,$hex-digit2)"/> |
| 342 |
</xsl:otherwise> |
| 343 |
</xsl:choose> |
| 344 |
<xsl:if test="string-length($str) > 1"> |
| 345 |
<xsl:call-template name="url-encode"> |
| 346 |
<xsl:with-param name="str" select="substring($str,2)"/> |
| 347 |
</xsl:call-template> |
| 348 |
</xsl:if> |
| 349 |
</xsl:if> |
| 350 |
</xsl:template> |
| 351 |
|
| 352 |
|
| 353 |
|
| 298 |
</xsl:stylesheet> |
354 |
</xsl:stylesheet> |
| 299 |
|
355 |
|
| 300 |
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. |
356 |
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. |
| 301 |
- |
|
|