1 <?xml version='1.0'?>
\r
2 <xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
\r
3 <xsl:template name="datafield">
\r
4 <xsl:param name="tag"/>
\r
5 <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
\r
6 <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
\r
7 <xsl:param name="subfields"/>
\r
8 <xsl:element name="datafield">
\r
9 <xsl:attribute name="tag">
\r
10 <xsl:value-of select="$tag"/>
\r
12 <xsl:attribute name="ind1">
\r
13 <xsl:value-of select="$ind1"/>
\r
15 <xsl:attribute name="ind2">
\r
16 <xsl:value-of select="$ind2"/>
\r
18 <xsl:copy-of select="$subfields"/>
\r
22 <xsl:template name="subfieldSelect">
\r
23 <xsl:param name="codes"/>
\r
24 <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
\r
25 <xsl:variable name="str">
\r
26 <xsl:for-each select="marc:subfield">
\r
27 <xsl:if test="contains($codes, @code)">
\r
28 <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>
\r
32 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
\r
35 <xsl:template name="buildSpaces">
\r
36 <xsl:param name="spaces"/>
\r
37 <xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
\r
38 <xsl:if test="$spaces>0">
\r
39 <xsl:value-of select="$char"/>
\r
40 <xsl:call-template name="buildSpaces">
\r
41 <xsl:with-param name="spaces" select="$spaces - 1"/>
\r
42 <xsl:with-param name="char" select="$char"/>
\r
43 </xsl:call-template>
\r
47 <xsl:template name="chopPunctuation">
\r
48 <xsl:param name="chopString"/>
\r
49 <xsl:variable name="length" select="string-length($chopString)"/>
\r
51 <xsl:when test="$length=0"/>
\r
52 <xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
\r
53 <xsl:call-template name="chopPunctuation">
\r
54 <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
\r
55 </xsl:call-template>
\r
57 <xsl:when test="not($chopString)"/>
\r
58 <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
\r
61 </xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
\r
63 <scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
\r