Lines 9-15
Link Here
|
9 |
<xsl:import href="MARC21slimUtils.xsl"/> |
9 |
<xsl:import href="MARC21slimUtils.xsl"/> |
10 |
<xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" /> |
10 |
<xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" /> |
11 |
<xsl:key name="item-by-status" match="items:item" use="items:status"/> |
11 |
<xsl:key name="item-by-status" match="items:item" use="items:status"/> |
12 |
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/> |
12 |
<xsl:if test="$OPACResultsBranchXSLT='holdingbranch'"> |
|
|
13 |
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/> |
14 |
</xsl:if> |
15 |
<xsl:if test="$OPACResultsBranchXSLT='homebranch'"> |
16 |
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/> |
17 |
</xsl:if> |
13 |
|
18 |
|
14 |
<xsl:template match="/"> |
19 |
<xsl:template match="/"> |
15 |
<xsl:apply-templates/> |
20 |
<xsl:apply-templates/> |
Lines 1014-1027
Link Here
|
1014 |
<b><xsl:text>Copies available for loan: </xsl:text></b> |
1019 |
<b><xsl:text>Copies available for loan: </xsl:text></b> |
1015 |
<xsl:variable name="available_items" |
1020 |
<xsl:variable name="available_items" |
1016 |
select="key('item-by-status', 'available')"/> |
1021 |
select="key('item-by-status', 'available')"/> |
1017 |
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]"> |
1022 |
<xsl:if test="$OPACResultsBranchXSLT='holdingbranch'"> |
1018 |
<xsl:value-of select="items:holdingbranch"/> |
1023 |
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]"> |
1019 |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> |
1024 |
<xsl:value-of select="items:holdingbranch"/> |
1020 |
<xsl:text> (</xsl:text> |
1025 |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> |
1021 |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/> |
1026 |
<xsl:text> (</xsl:text> |
1022 |
<xsl:text>)</xsl:text> |
1027 |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/> |
1023 |
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> |
1028 |
<xsl:text>)</xsl:text> |
1024 |
</xsl:for-each> |
1029 |
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> |
|
|
1030 |
</xsl:for-each> |
1031 |
</xsl:if> |
1032 |
<xsl:if test="$OPACResultsBranchXSLT='homebranch'"> |
1033 |
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> |
1034 |
<xsl:value-of select="items:homebranch"/> |
1035 |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> |
1036 |
<xsl:text> (</xsl:text> |
1037 |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> |
1038 |
<xsl:text>)</xsl:text> |
1039 |
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> |
1040 |
</xsl:for-each> |
1041 |
</xsl:if> |
1025 |
</span> |
1042 |
</span> |
1026 |
</xsl:when> |
1043 |
</xsl:when> |
1027 |
</xsl:choose> |
1044 |
</xsl:choose> |
Lines 1036-1051
Link Here
|
1036 |
<xsl:when test="count(key('item-by-status', 'reference'))>0"> |
1053 |
<xsl:when test="count(key('item-by-status', 'reference'))>0"> |
1037 |
<span class="available"> |
1054 |
<span class="available"> |
1038 |
<b><xsl:text>Copies available for reference: </xsl:text></b> |
1055 |
<b><xsl:text>Copies available for reference: </xsl:text></b> |
1039 |
<xsl:variable name="reference_items" |
1056 |
<xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> |
1040 |
select="key('item-by-status', 'reference')"/> |
1057 |
<xsl:if test="$OPACResultsBranchXSLT='holdingbranch'"> |
1041 |
<xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]"> |
1058 |
<xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]"> |
1042 |
<xsl:value-of select="items:holdingbranch"/> |
1059 |
<xsl:value-of select="items:holdingbranch"/> |
1043 |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> |
1060 |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> |
1044 |
<xsl:text> (</xsl:text> |
1061 |
<xsl:text> (</xsl:text> |
1045 |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/> |
1062 |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/> |
1046 |
<xsl:text>)</xsl:text> |
1063 |
<xsl:text>)</xsl:text> |
1047 |
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> |
1064 |
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> |
1048 |
</xsl:for-each> |
1065 |
</xsl:for-each> |
|
|
1066 |
</xsl:if> |
1067 |
<xsl:if test="$OPACResultsBranchXSLT='homebranch'"> |
1068 |
<xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> |
1069 |
<xsl:value-of select="items:homebranch"/> |
1070 |
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> |
1071 |
<xsl:text> (</xsl:text> |
1072 |
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> |
1073 |
<xsl:text>)</xsl:text> |
1074 |
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> |
1075 |
</xsl:for-each> |
1076 |
</xsl:if> |
1049 |
</span> |
1077 |
</span> |
1050 |
</xsl:when> |
1078 |
</xsl:when> |
1051 |
</xsl:choose> |
1079 |
</xsl:choose> |
1052 |
- |
|
|