]> granicus.if.org Git - docbook-dsssl/commitdiff
Support task
authorNorman Walsh <ndw@nwalsh.com>
Wed, 27 Aug 2003 14:29:19 +0000 (14:29 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 27 Aug 2003 14:29:19 +0000 (14:29 +0000)
xsl/fo/docbook.xsl
xsl/fo/task.xsl [new file with mode: 0644]
xsl/html/docbook.xsl
xsl/html/task.xsl [new file with mode: 0644]

index e6eb35f6fd578db722942eea45bcd335e22725ee..cf201c9ed44a628fd1656ac0e77313b09a730361 100644 (file)
@@ -58,6 +58,7 @@
 <xsl:include href="biblio.xsl"/>
 <xsl:include href="glossary.xsl"/>
 <xsl:include href="block.xsl"/>
+<xsl:include href="task.xsl"/>
 <xsl:include href="qandaset.xsl"/>
 <xsl:include href="synop.xsl"/>
 <xsl:include href="titlepage.xsl"/>
diff --git a/xsl/fo/task.xsl b/xsl/fo/task.xsl
new file mode 100644 (file)
index 0000000..d90a31a
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+<xsl:template match="task">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="param.placement"
+                select="substring-after(normalize-space($formal.title.placement),
+                                        concat(local-name(.), ' '))"/>
+
+  <xsl:variable name="placement">
+    <xsl:choose>
+      <xsl:when test="contains($param.placement, ' ')">
+        <xsl:value-of select="substring-before($param.placement, ' ')"/>
+      </xsl:when>
+      <xsl:when test="$param.placement = ''">before</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$param.placement"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                              or self::titleabbrev)]"/>
+
+  <fo:block id="{$id}"
+            xsl:use-attribute-sets="formal.object.properties">
+    <xsl:call-template name="anchor"/>
+
+    <xsl:if test="title and $placement = 'before'">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="$preamble"/>
+
+    <xsl:if test="title and $placement != 'before'">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="task/title">
+  <!-- nop -->
+</xsl:template>
+
+<xsl:template match="tasksummary">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="taskprerequisites">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="taskrelated">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+</xsl:stylesheet>
index 94157cbb5366ad3817e5123043d4c77784a3fca8..80106977b0a032cf56eb0498a7fb5baba3000b07 100644 (file)
@@ -56,6 +56,7 @@
 <xsl:include href="biblio.xsl"/>
 <xsl:include href="glossary.xsl"/>
 <xsl:include href="block.xsl"/>
+<xsl:include href="task.xsl"/>
 <xsl:include href="qandaset.xsl"/>
 <xsl:include href="synop.xsl"/>
 <xsl:include href="titlepage.xsl"/>
diff --git a/xsl/html/task.xsl b/xsl/html/task.xsl
new file mode 100644 (file)
index 0000000..9ceb009
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+<xsl:template match="task">
+  <xsl:variable name="param.placement"
+                select="substring-after(normalize-space($formal.title.placement),
+                                        concat(local-name(.), ' '))"/>
+
+  <xsl:variable name="placement">
+    <xsl:choose>
+      <xsl:when test="contains($param.placement, ' ')">
+        <xsl:value-of select="substring-before($param.placement, ' ')"/>
+      </xsl:when>
+      <xsl:when test="$param.placement = ''">before</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$param.placement"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                              or self::titleabbrev)]"/>
+
+  <div class="{name(.)}">
+    <xsl:call-template name="anchor"/>
+
+    <xsl:if test="title and $placement = 'before'">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="$preamble"/>
+
+    <xsl:if test="title and $placement != 'before'">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+  </div>
+</xsl:template>
+
+<xsl:template match="task/title">
+  <!-- nop -->
+</xsl:template>
+
+<xsl:template match="tasksummary">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="taskprerequisites">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="taskrelated">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+</xsl:stylesheet>