Only insert those index terms which have @search="true". This happens both for
authorAnders S. Mortensen <sondberg@indexdata.dk>
Mon, 2 Apr 2007 10:11:17 +0000 (10:11 +0000)
committerAnders S. Mortensen <sondberg@indexdata.dk>
Mon, 2 Apr 2007 10:11:17 +0000 (10:11 +0000)
the situation where search access points have actually been probed by IRspy and
in the case where only the existing version of indexInfo is inserted. Bugzilla
#922.

xsl/irspy2zeerex.xsl

index 6ac8cd2..e08fa90 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-    $Id: irspy2zeerex.xsl,v 1.19 2007-03-30 17:17:44 sondberg Exp $
+    $Id: irspy2zeerex.xsl,v 1.20 2007-04-02 10:11:17 sondberg Exp $
 
     This stylesheet is used by IRSpy to map the internal mixed Zeerex/IRSpy
     record format into the Zeerex record which we store.
@@ -73,7 +73,8 @@
 
         <!-- If not, insert what we already had... -->
         <xsl:otherwise>
-          <xsl:copy-of select="explain:indexInfo/*"/>
+          <xsl:copy-of
+                select="explain:indexInfo/explain:index[@search='true']"/>
         </xsl:otherwise>
       </xsl:choose>
     </indexInfo>
       </xsl:call-template>
     </xsl:param>
 
-    <index>
-      <xsl:attribute name="search">
-        <xsl:choose>
-          <xsl:when test="$update/@ok = 1">true</xsl:when>
-          <xsl:otherwise>false</xsl:otherwise>
-        </xsl:choose>
-      </xsl:attribute>
-      <title primary="true" lang="en">
-        <xsl:value-of select="$title"/>
-      </title>
-      <map primary="true">
-        <attr type="1" set="{$update/@set}">
-          <xsl:value-of select="$update/@ap"/>
-        </attr>
-      </map>
-    </index>
+    <xsl:if test="$update/@ok = 1">
+      <index search="true">
+        <title primary="true" lang="en"><xsl:value-of select="$title"/></title>
+        <map primary="true">
+          <attr type="1" set="{$update/@set}">
+            <xsl:value-of select="$update/@ap"/>
+          </attr>
+        </map>
+      </index>
+    </xsl:if>
   </xsl:template>