library-web r448 - in trunk: . data/xslt



Author: fpeters
Date: Thu May  8 20:52:07 2008
New Revision: 448
URL: http://svn.gnome.org/viewvc/library-web?rev=448&view=rev

Log:
* data/xslt/indexes.xsl: Rarian 0.8 changed all toc id; as library
still needs to handle older documents, here is a quick mapping; so
library is able to use newer toc.xml (needed for translations).



Modified:
   trunk/ChangeLog
   trunk/data/xslt/indexes.xsl

Modified: trunk/data/xslt/indexes.xsl
==============================================================================
--- trunk/data/xslt/indexes.xsl	(original)
+++ trunk/data/xslt/indexes.xsl	Thu May  8 20:52:07 2008
@@ -49,10 +49,38 @@
   <xsl:template name="category-title">
     <xsl:param name="lang"/>
     <xsl:param name="tocid"/>
-    <xsl:param name="cat-icon" select="document('../externals/toc.xml')//toc[ id = $tocid]/@icon"/>
+
+    <xsl:variable name="rtocid">
+      <xsl:choose>
+        <xsl:when test="document('../externals/toc.xml')//toc[ id = $tocid]">
+          <xsl:value-of select="$tocid"/>
+        </xsl:when>
+	<!-- Rarian 0.8 changed all toc id; as library still needs to handle
+	     older documents, here is a quick mapping -->
+        <xsl:when test="$tocid = 'index'">Core</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsAccessibility'">Accessibility</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsAccessories'">Utility</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsEducation'">Education</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsGames'">Games</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsGraphics'">Graphics</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsInternet'">Network</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsOffice'">Office</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsOther'">Other</xsl:when>
+        <xsl:when test="$tocid = 'DesktopApplets'">Other</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsProgramming'">Development</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsScientific'">Science</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsMultimedia'">AudioVideo</xsl:when>
+        <xsl:when test="$tocid = 'ApplicationsSystem'">System</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:message>tocid (<xsl:value-of select="$tocid"/>) is now <xsl:value-of
+    select="$rtocid"/></xsl:message>
 
     <xsl:choose>
-      <xsl:when test="document('../externals/toc.xml')//toc[ id = $tocid]/title">
+      <xsl:when test="document('../externals/toc.xml')//toc[ id = $rtocid]/title">
+        <xsl:variable name="cat-icon"
+                select="document('../externals/toc.xml')//toc[ id = $rtocid]/@icon"/>
         <h2>
           <xsl:attribute name="class">category<xsl:if test="$cat-icon != ''"
                 > cat-<xsl:value-of select="$cat-icon"/></xsl:if></xsl:attribute>
@@ -60,11 +88,11 @@
             <xsl:attribute name="id"><xsl:value-of select="$cat-icon"/></xsl:attribute>
           </xsl:if>
         <xsl:choose>
-          <xsl:when test="document('../externals/toc.xml')//toc[ id = $tocid]/title[ xml:lang = $lang]">
-            <xsl:value-of select="document('../externals/toc.xml')//toc[ id = $tocid]/title[ xml:lang = $lang]"/>
+          <xsl:when test="document('../externals/toc.xml')//toc[ id = $rtocid]/title[ xml:lang = $lang]">
+            <xsl:value-of select="document('../externals/toc.xml')//toc[ id = $rtocid]/title[ xml:lang = $lang]"/>
           </xsl:when>
           <xsl:otherwise>
-            <xsl:value-of select="document('../externals/toc.xml')//toc[ id = $tocid]/title"/>
+            <xsl:value-of select="document('../externals/toc.xml')//toc[ id = $rtocid]/title"/>
           </xsl:otherwise>
         </xsl:choose>
         </h2>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]