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 (from parent 1:
463c7fb
)
Support for float(like score) and int (not used yet)
author
Dennis Schafroth
<dennis@indexdata.com>
Tue, 18 Sep 2012 15:45:26 +0000
(17:45 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Tue, 18 Sep 2012 15:45:26 +0000
(17:45 +0200)
test/solr-pz2.xsl
patch
|
blob
|
history
diff --git
a/test/solr-pz2.xsl
b/test/solr-pz2.xsl
index
4267f99
..
9a0cb9f
100644
(file)
--- a/
test/solr-pz2.xsl
+++ b/
test/solr-pz2.xsl
@@
-1,21
+1,44
@@
<?xml version="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:template match="/">
- <xsl:apply-templates></xsl:apply-templates>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pz="http://www.indexdata.com/pazpar2/1.0" version="1.0">
+
+ <xsl:param name="medium"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
</xsl:template>
</xsl:template>
+ <xsl:template match="lst[@name='responseHeader']"/>
+
<xsl:template match="doc">
<pz:record>
<xsl:template match="doc">
<pz:record>
- <xsl:apply-templates></xsl:apply-templates>
+ <xsl:apply-templates/>
</pz:record>
</xsl:template>
</pz:record>
</xsl:template>
+
+ <xsl:template match="float[@name]">
+ <pz:metadata>
+ <xsl:attribute name="type">
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="int[@name]">
+ <pz:metadata>
+ <xsl:attribute name="type">
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
<xsl:template match="str[@name]">
<pz:metadata>
<xsl:template match="str[@name]">
<pz:metadata>
- <xsl:attribute name="type">
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:value-of select="."/>
+ <xsl:attribute name="type">
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+ <xsl:value-of select="."/>
</pz:metadata>
</xsl:template>
</pz:metadata>
</xsl:template>
@@
-26,12
+49,19
@@
</xsl:template>
<xsl:template name="string">
</xsl:template>
<xsl:template name="string">
- <pz:metadata>
- <xsl:attribute name="type">
- <xsl:value-of select="../@name"/>
- </xsl:attribute>
- <xsl:value-of select="."/>
- </pz:metadata>
+ <pz:metadata>
+ <xsl:attribute name="type">
+ <xsl:value-of select="../@name"/>
+ </xsl:attribute>
+ <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>
</xsl:stylesheet>
</xsl:template>
</xsl:stylesheet>