3 $Id: irspy2zeerex.xsl,v 1.3 2006-10-27 11:45:18 sondberg Exp $
5 This stylesheet is used by IRSpy to map the internal mixed Zeerex/IRSpy
6 record format into the Zeerex record which we store.
10 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 xmlns:irspy="http://indexdata.com/irspy/1.0"
12 xmlns="http://explain.z3950.org/dtd/2.0/"
13 xmlns:explain="http://explain.z3950.org/dtd/2.0/"
14 exclude-result-prefixes="irspy explain"
17 <xsl:output indent="yes"
22 <xsl:preserve-space elements="*"/>
24 <xsl:variable name="old_indexes" select="/*/explain:indexInfo/explain:index"/>
25 <xsl:variable name="old_syntaxes" select="/*/explain:recordInfo"/>
28 <xsl:template match="node() | @*">
30 <xsl:apply-templates select="@* | node()"/>
35 <xsl:template match="explain:indexInfo">
37 <xsl:for-each select="/*/irspy:status/irspy:search">
38 <xsl:variable name="set" select="@set"/>
39 <xsl:variable name="ap" select="@ap"/>
40 <xsl:variable name="old"
41 select="$old_indexes[explain:map/explain:attr/@set = $set and
42 explain:map/explain:attr/text() = $ap]"/>
44 <xsl:when test="$old">
45 <xsl:call-template name="insert-index-section">
46 <xsl:with-param name="title" select="$old/explain:title"/>
50 <xsl:call-template name="insert-index-section"/>
58 <xsl:template match="explain:recordInfo">
62 <xsl:template name="insert-index-section">
63 <xsl:param name="update" select="."/>
64 <xsl:param name="title">
65 <xsl:call-template name="insert-index-title">
66 <xsl:with-param name="update" select="$update"/>
71 <xsl:attribute name="search">
73 <xsl:when test="$update/@ok = 1">true</xsl:when>
74 <xsl:otherwise>false</xsl:otherwise>
77 <title primary="true" lang="en">
78 <xsl:value-of select="$title"/>
81 <attr type="1" set="{$update/@set}">
82 <xsl:value-of select="$update/@ap"/>
89 <xsl:template name="insert-index-title">
90 <xsl:param name="update"/>
91 <xsl:value-of select="$update/@ap"/>
96 <xsl:template match="explain:dateModified">
97 <dateModified><xsl:value-of
98 select="/*/irspy:status/*[last()]"/></dateModified>