]> granicus.if.org Git - docbook-dsssl/commitdiff
Used for litprog refentryes
authorNorman Walsh <ndw@nwalsh.com>
Mon, 8 Oct 2001 12:41:12 +0000 (12:41 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 8 Oct 2001 12:41:12 +0000 (12:41 +0000)
xsl/docsrc/lrefentry.xsl [new file with mode: 0644]

diff --git a/xsl/docsrc/lrefentry.xsl b/xsl/docsrc/lrefentry.xsl
new file mode 100644 (file)
index 0000000..737f665
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
+                xmlns:verb="com.nwalsh.saxon.Verbatim"
+                exclude-result-prefixes="src verb"
+                version="1.0">
+
+<xsl:import href="../../litprog/html/ldocbook.xsl"/>
+
+<xsl:template match="src:fragment" mode="xref-to">
+  <xsl:variable name="section" select="ancestor::refentry[1]"/>
+
+  <i>
+    <xsl:text>&#xA7;</xsl:text>
+    <xsl:apply-templates select="$section" mode="label.markup"/>
+    <xsl:number from="/" level="any"/>
+    <xsl:text>. </xsl:text>
+    <xsl:apply-templates select="$section" mode="title.markup"/>
+  </i>
+</xsl:template>
+
+<xsl:template match="src:fragment" mode="xref-to-section">
+  <xsl:variable name="section" select="ancestor::refentry[1]"/>
+
+  <i>
+    <xsl:text>&#xA7;</xsl:text>
+    <xsl:apply-templates select="$section" mode="label.markup"/>
+    <xsl:number from="/" level="any"/>
+  </i>
+</xsl:template>
+
+<xsl:template match="src:fragment">
+  <xsl:param name="suppress-numbers" select="'0'"/>
+  <xsl:param name="linenumbering" select="'numbered'"/>
+  <xsl:variable name="section" select="ancestor::section[1]"/>
+
+  <a name="{@id}"/>
+  <table border="1" width="100%">
+    <tr>
+      <td>
+        <p>
+          <b>
+            <xsl:text>&#xA7;</xsl:text>
+            <xsl:apply-templates select="$section" mode="label.markup"/>
+            <xsl:number from="/" level="any"/>
+          </b>
+        </p>
+      </td>
+    </tr>
+    <tr>
+      <td>
+        <xsl:choose>
+          <xsl:when test="$suppress-numbers = '0'
+                          and $linenumbering = 'numbered'
+                          and $use.extensions != '0'
+                          and $linenumbering.extension != '0'">
+            <xsl:variable name="rtf">
+              <xsl:apply-templates/>
+            </xsl:variable>
+            <pre class="{name(.)}">
+              <xsl:copy-of select="verb:numberLines($rtf)"/>
+            </pre>
+          </xsl:when>
+          <xsl:otherwise>
+            <pre class="{name(.)}">
+              <xsl:apply-templates/>
+            </pre>
+          </xsl:otherwise>
+        </xsl:choose>
+      </td>
+    </tr>
+  </table>
+</xsl:template>
+
+</xsl:stylesheet>