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