summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2007-02-19 22:17:10 +0000
committerShaun McCance <shaunm@src.gnome.org>2007-02-19 22:17:10 +0000
commit44fcb02698411e7730ccd3ebdb2f5dcc2a335b09 (patch)
tree45a5dd8014cc592ea218a54dea092af987eb3a79
parenta45bc0f73dd5643487d48953883fdb4d78a2f2f0 (diff)
downloadgnome-doc-utils-44fcb02698411e7730ccd3ebdb2f5dcc2a335b09.tar.gz
- Started getting guide links from the cache
* xslt/mal2html.xsl: - Started getting guide links from the cache * spec/mal_code.xml: - The id is mal_code, not mal_block_code svn path=/trunk/; revision=886
-rw-r--r--sandbox/mallard/ChangeLog8
-rw-r--r--sandbox/mallard/spec/mal_code.xml2
-rw-r--r--sandbox/mallard/xslt/mal2html.xsl41
3 files changed, 34 insertions, 17 deletions
diff --git a/sandbox/mallard/ChangeLog b/sandbox/mallard/ChangeLog
index 2e45170..048975c 100644
--- a/sandbox/mallard/ChangeLog
+++ b/sandbox/mallard/ChangeLog
@@ -1,5 +1,13 @@
2007-02-19 Shaun McCance <shaunm@gnome.org>
+ * xslt/mal2html.xsl:
+ - Started getting guide links from the cache
+
+ * spec/mal_code.xml:
+ - The id is mal_code, not mal_block_code
+
+2007-02-19 Shaun McCance <shaunm@gnome.org>
+
* spec/mal_list_tree.xml:
- Changed RNG for tree lists
diff --git a/sandbox/mallard/spec/mal_code.xml b/sandbox/mallard/spec/mal_code.xml
index f59dcfd..34a6aff 100644
--- a/sandbox/mallard/spec/mal_code.xml
+++ b/sandbox/mallard/spec/mal_code.xml
@@ -1,5 +1,5 @@
<topic xmlns="http://www.gnome.org/~shaunm/mallard"
- id="mal_block_code">
+ id="mal_code">
<info>
<link type="guide" xref="mal_block#simple"/>
<link type="guide" xref="mal_inline"/>
diff --git a/sandbox/mallard/xslt/mal2html.xsl b/sandbox/mallard/xslt/mal2html.xsl
index 29343d4..6636c10 100644
--- a/sandbox/mallard/xslt/mal2html.xsl
+++ b/sandbox/mallard/xslt/mal2html.xsl
@@ -41,9 +41,10 @@ REMARK: Describe this module
<xsl:param name="mal.extension" select="'.xhtml'"/>
<xsl:param name="mal.cache_file"/>
<xsl:variable name="cache" select="document($mal.cache_file)"/>
-<xsl:key name="cache_page" match="$cache//mal:guide | $cache//mal:topic" use="@id"/>
-<xsl:key name="cache_sect" match="$cache//mal:section"
- use="concat((ancestor::mal:guide | ancesotr::mal:topic)[1]/@id, '#', @id)"/>
+<xsl:key name="cache_key" match="*[@id]"
+ use="concat(
+ (ancestor-or-self::mal:guide | ancestor-or-self::mal:topic)[last()]/@id,
+ '#', @id)"/>
<xsl:template match="/">
<html>
@@ -66,19 +67,27 @@ REMARK: Describe this module
<xsl:apply-templates mode="mal2html.block.mode"
select="*[not(self::mal:section)]"/>
<xsl:for-each select="mal:info/mal:link[@type = 'page']">
- <xsl:choose>
- <xsl:when test="not(@xref)"/>
- <xsl:when test="contains(@xref, '#')">
- <div>
- <xsl:value-of select="key('cache_sect', @xref)/mal:title"/>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <div>
- <xsl:value-of select="key('cache_page', @xref)/mal:title"/>
- </div>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:variable name="id">
+ <xsl:choose>
+ <xsl:when test="contains(@xref, '#')">
+ <xsl:value-of select="@xref"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(@xref, '#', @xref)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <div>
+ <xsl:for-each select="$cache/mal:cache">
+ <xsl:apply-templates select="key('cache_key', $id)/mal:title/node()"/>
+ </xsl:for-each>
+ </div>
+ </xsl:for-each>
+ <xsl:variable name="id" select="@id"/>
+ <xsl:for-each select="$cache/*/*[mal:info/mal:link[@type = 'guide'][@xref = $id]]">
+ <div>
+ <xsl:apply-templates select="mal:title/node()"/>
+ </div>
</xsl:for-each>
<xsl:apply-templates select="mal:section"/>
</xsl:template>