summaryrefslogtreecommitdiffstats
path: root/kdoctools/docbook/xsl/manpages/xref.xsl
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /kdoctools/docbook/xsl/manpages/xref.xsl
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdoctools/docbook/xsl/manpages/xref.xsl')
-rw-r--r--kdoctools/docbook/xsl/manpages/xref.xsl44
1 files changed, 44 insertions, 0 deletions
diff --git a/kdoctools/docbook/xsl/manpages/xref.xsl b/kdoctools/docbook/xsl/manpages/xref.xsl
new file mode 100644
index 000000000..671b87d93
--- /dev/null
+++ b/kdoctools/docbook/xsl/manpages/xref.xsl
@@ -0,0 +1,44 @@
+<?xml version='1.0'?>
+<!-- vim:set sts=2 shiftwidth=2 syntax=sgml: -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'>
+
+<xsl:template match="xref">
+ <xsl:variable name="targets" select="key('id', @linkend)"/>
+ <xsl:variable name="target" select="$targets[1]"/>
+ <xsl:variable name="type" select="local-name($target)"/>
+
+ <xsl:choose>
+ <xsl:when test="$type=''">
+ <xsl:message>
+ <xsl:text>xref to nonexistent id </xsl:text>
+ <xsl:value-of select="@linkend"/>
+ </xsl:message>
+ </xsl:when>
+
+ <xsl:when test="$type='refentry'">
+ <xsl:call-template name="do-citerefentry">
+ <xsl:with-param name="refentrytitle"
+ select="$target/refmeta/refentrytitle[1]"/>
+ <xsl:with-param name="manvolnum"
+ select="$target/refmeta/manvolnum"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="$type='refname'">
+ <xsl:call-template name="do-citerefentry">
+ <xsl:with-param name="refentrytitle" select="$target"/>
+ <xsl:with-param name="manvolnum"
+ select="$target/../../refmeta/manvolnum"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:text>[xref to </xsl:text>
+ <xsl:value-of select="$type"/>
+ <xsl:text>]</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>