projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80a8245
)
Overrides record medium type with per-target medium type
author
Niels Erik G. Nielsen
<nielserik@indexdata.com>
Fri, 22 Oct 2010 21:26:43 +0000
(23:26 +0200)
committer
Niels Erik G. Nielsen
<nielserik@indexdata.com>
Fri, 22 Oct 2010 21:26:43 +0000
(23:26 +0200)
etc/solr-pz2.xsl
patch
|
blob
|
history
diff --git
a/etc/solr-pz2.xsl
b/etc/solr-pz2.xsl
index
4267f99
..
e966711
100644
(file)
--- a/
etc/solr-pz2.xsl
+++ b/
etc/solr-pz2.xsl
@@
-1,6
+1,9
@@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pz="http://www.indexdata.com/pazpar2/1.0" >
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pz="http://www.indexdata.com/pazpar2/1.0" >
+
+ <xsl:param name="medium" />
+
<xsl:template match="/">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
@@
-10,6
+13,7
@@
<xsl:apply-templates></xsl:apply-templates>
</pz:record>
</xsl:template>
<xsl:apply-templates></xsl:apply-templates>
</pz:record>
</xsl:template>
+
<xsl:template match="str[@name]">
<pz:metadata>
<xsl:attribute name="type">
<xsl:template match="str[@name]">
<pz:metadata>
<xsl:attribute name="type">
@@
-30,7
+34,14
@@
<xsl:attribute name="type">
<xsl:value-of select="../@name"/>
</xsl:attribute>
<xsl:attribute name="type">
<xsl:value-of select="../@name"/>
</xsl:attribute>
- <xsl:value-of select="."/>
+ <xsl:choose>
+ <xsl:when test="../@name = 'medium' and string-length($medium) > 0">
+ <xsl:value-of select="$medium"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
</pz:metadata>
</xsl:template>
</pz:metadata>
</xsl:template>