<?xml version="1.0"?>
<!--
- $Id: irspy2zeerex.xsl,v 1.5 2006-10-27 12:50:06 sondberg Exp $
+ $Id: irspy2zeerex.xsl,v 1.8 2006-10-30 14:55:27 sondberg Exp $
This stylesheet is used by IRSpy to map the internal mixed Zeerex/IRSpy
record format into the Zeerex record which we store.
<xsl:variable name="old_indexes" select="/*/explain:indexInfo/explain:index"/>
<xsl:variable name="use_attr_names" select="document('use-attr-names.xml')"/>
-
+
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:template>
- <xsl:template match="explain:indexInfo">
+ <xsl:template match="/*">
+ <explain>
+ <xsl:apply-templates select="explain:serverInfo |
+ explain:databaseInfo |
+ explain:metaInfo"/>
+
+ <xsl:call-template name="insert-indexInfo"/>
+ <xsl:call-template name="insert-recordInfo"/>
+ <xsl:call-template name="insert-irspySection"/>
+ </explain>
+ </xsl:template>
+
+
+ <xsl:template name="insert-indexInfo">
<indexInfo>
<xsl:for-each select="/*/irspy:status/irspy:search">
<xsl:variable name="set" select="@set"/>
</xsl:template>
- <xsl:template match="explain:recordInfo">
+ <xsl:template name="insert-recordInfo">
<recordInfo>
<xsl:for-each select="/*/irspy:status/irspy:record_fetch[@ok = 1]">
<recordSyntax name="{@syntax}">
</xsl:template>
+ <xsl:template name="insert-irspySection">
+ <xsl:copy-of select="/*/irspy:status"/>
+ </xsl:template>
+
+
<xsl:template name="insert-index-section">
<xsl:param name="update" select="."/>
<xsl:param name="title">
<xsl:template name="insert-index-title">
<xsl:param name="update"/>
<xsl:variable name="name"
- select="$use_attr_names/*/map[@attr = $update/@ap]/@name"/>
+ select="$use_attr_names/*/map[@attr = $update/@ap and
+ @set = $update/@set]/@name"/>
<xsl:choose>
<xsl:when test="string-length($name) > 0"><xsl:value-of