projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Example MARC indexing XSL uses leader to control update
[idzebra-moved-to-github.git]
/
examples
/
marcxml
/
MARC21slim2INDEX.xsl
diff --git
a/examples/marcxml/MARC21slim2INDEX.xsl
b/examples/marcxml/MARC21slim2INDEX.xsl
index
9078597
..
0d42860
100644
(file)
--- a/
examples/marcxml/MARC21slim2INDEX.xsl
+++ b/
examples/marcxml/MARC21slim2INDEX.xsl
@@
-47,6
+47,13
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
<!-- match on marcxml record -->
<xsl:template match="marc:record">
<xsl:variable name="leader" select="marc:leader"/>
<!-- match on marcxml record -->
<xsl:template match="marc:record">
<xsl:variable name="leader" select="marc:leader"/>
+ <xsl:variable name="leader5" select="substring($leader,6,1)"/>
+ <xsl:variable name="type">
+ <xsl:choose>
+ <xsl:when test="$leader5='d'">delete</xsl:when>
+ <xsl:otherwise>update</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
<xsl:variable name="controlField001"
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
<xsl:variable name="controlField001"
@@
-75,7
+82,7
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
</xsl:choose>
</xsl:variable>
</xsl:choose>
</xsl:variable>
- <z:record z:id="{$controlField001}" type="update">
+ <z:record z:id="{$controlField001}" type="{$type}">
<!-- <xsl:attribute name="id"></xsl:attribute> -->
<!-- <xsl:attribute name="id"></xsl:attribute> -->