[yelp-xsl/wip/api-1-0] mal2html-api: Sort according to api:name first



commit 8f46d17a2636b2a650c70e02f5c8a55b096cc010
Author: Shaun McCance <shaunm gnome org>
Date:   Fri Mar 16 09:52:44 2012 -0400

    mal2html-api: Sort according to api:name first

 xslt/mallard/html/mal2html-api.xsl |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/xslt/mallard/html/mal2html-api.xsl b/xslt/mallard/html/mal2html-api.xsl
index d160296..8be7762 100644
--- a/xslt/mallard/html/mal2html-api.xsl
+++ b/xslt/mallard/html/mal2html-api.xsl
@@ -53,8 +53,26 @@ elements. It should be called by an appropriate template that handles the
 <xsl:template name="mal2html.api.links">
   <xsl:param name="node"/>
   <xsl:param name="links"/>
-  <xsl:variable name="out_">
+  <xsl:variable name="apilinks_">
     <xsl:for-each select="$links">
+      <xsl:variable name="link" select="."/>
+      <xsl:for-each select="$mal.cache">
+        <xsl:variable name="target" select="key('mal.cache.key', $link/@xref)"/>
+        <xsl:variable name="apiname" select="$target/mal:info/api:*/api:name[1]"/>
+        <xsl:for-each select="$link">
+          <xsl:copy>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="*"/>
+            <xsl:copy-of select="$apiname"/>
+          </xsl:copy>
+        </xsl:for-each>
+      </xsl:for-each>
+    </xsl:for-each>
+  </xsl:variable>
+  <xsl:variable name="apilinks" select="exsl:node-set($apilinks_)/*"/>
+  <xsl:variable name="out_">
+    <xsl:for-each select="$apilinks">
+      <xsl:sort select="api:name"/>
       <xsl:sort data-type="number" select="@groupsort"/>
       <xsl:sort select="mal:title[ type = 'sort']"/>
       <xsl:variable name="link" select="."/>



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