[yelp-xsl/wip/api-1-0] mal-link: Implicit api:name link role



commit 691dc2a967a95df5fc9827ce67d07da2cf100bb7
Author: Shaun McCance <shaunm gnome org>
Date:   Fri Mar 16 15:48:47 2012 -0400

    mal-link: Implicit api:name link role

 test/api/func3.page              |    2 +-
 test/api/type1.page              |    5 ++++-
 xslt/mallard/common/mal-link.xsl |    7 ++++++-
 3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/test/api/func3.page b/test/api/func3.page
index f46bf1e..bf4cf21 100644
--- a/test/api/func3.page
+++ b/test/api/func3.page
@@ -6,7 +6,7 @@
 <info>
   <api:function>
     <api:returns>
-      <api:type><link xref="type1"/></api:type>
+      <api:type><link xref="type1" role="api:name"/></api:type>
     </api:returns>
     <api:name>function_3</api:name>
   </api:function>
diff --git a/test/api/type1.page b/test/api/type1.page
index ecf9670..adbf886 100644
--- a/test/api/type1.page
+++ b/test/api/type1.page
@@ -5,8 +5,11 @@
 
 <info>
   <link type="guide" xref="index"/>
+  <api:type>
+    <api:name>type1</api:name>
+  </api:type>
 </info>
 
-<title>type1</title>
+<title>Type #1</title>
 
 </page>
diff --git a/xslt/mallard/common/mal-link.xsl b/xslt/mallard/common/mal-link.xsl
index 63cf424..623e0c9 100644
--- a/xslt/mallard/common/mal-link.xsl
+++ b/xslt/mallard/common/mal-link.xsl
@@ -20,9 +20,10 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
                 xmlns:mal="http://projectmallard.org/1.0/";
                 xmlns:cache="http://projectmallard.org/cache/1.0/";
                 xmlns:facet="http://projectmallard.org/facet/1.0/";
+                xmlns:api="http://projectmallard.org/experimental/api/";
                 xmlns:exsl="http://exslt.org/common";
                 xmlns:str="http://exslt.org/strings";
-                exclude-result-prefixes="mal cache facet exsl str"
+                exclude-result-prefixes="mal cache facet api exsl str"
                 version="1.0">
 
 <!--!!==========================================================================
@@ -255,6 +256,10 @@ page or section cannot be found, ${xref} is used as the text content.
                 <xsl:apply-templates mode="mal.link.content.mode"
                                      select="$titles[ role = $role][1]/node()"/>
               </xsl:when>
+              <xsl:when test="$role = 'api:name' and $target/mal:info/api:*/api:name">
+                <xsl:apply-templates mode="mal.link.content.mode"
+                                     select="$target/mal:info/api:*/api:name[1]/node()"/>
+              </xsl:when>
               <xsl:when test="$titles[not(@role)]">
                 <xsl:apply-templates mode="mal.link.content.mode"
                                      select="$titles[not(@role)][1]/node()"/>



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