]> granicus.if.org Git - docbook-dsssl/commitdiff
Use xsl:choose to support xml, html, and text output methods
authorNorman Walsh <ndw@nwalsh.com>
Wed, 4 Apr 2001 11:41:29 +0000 (11:41 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 4 Apr 2001 11:41:29 +0000 (11:41 +0000)
xsl/html/xtchunker.xsl

index 202e2851eeacf076a5ed9c9961dbcc5b1ce49b67..62837df919b3de6deffaeba4aa97932600988a2c 100644 (file)
   <xsl:param name="filename" select="''"/>
   <xsl:param name="method" select="'html'"/>
   <xsl:param name="encoding" select="'ISO-8859-1'"/>
+  <xsl:param name="indent" select="'no'"/>
   <xsl:param name="content" select="''"/>
 
+  <xsl:message>
+    <xsl:text>Writing </xsl:text>
+    <xsl:value-of select="$filename"/>
+    <xsl:if test="name(.) != ''">
+      <xsl:text> for </xsl:text>
+      <xsl:value-of select="name(.)"/>
+    </xsl:if>
+  </xsl:message>
+
   <!-- apparently XT doesn't support AVTs for method and encoding -->
-  <xt:document href="{$filename}"
-               method="html"
-               encoding="ISO-8859-1">
-    <xsl:copy-of select="$content"/>
-  </xt:document>
+  <xsl:choose>
+    <xsl:when test="$method = 'xml'">
+      <xt:document href="{$filename}"
+                   method="xml"
+                   indent="{$indent}"
+                   encoding="ISO-8859-1">
+        <xsl:copy-of select="$content"/>
+      </xt:document>
+    </xsl:when>
+    <xsl:when test="$method = 'text'">
+      <xt:document href="{$filename}"
+                   method="text"
+                   indent="{$indent}"
+                   encoding="ISO-8859-1">
+        <xsl:copy-of select="$content"/>
+      </xt:document>
+    </xsl:when>
+    <xsl:otherwise>
+      <xt:document href="{$filename}"
+                   method="html"
+                   indent="{$indent}"
+                   encoding="ISO-8859-1">
+        <xsl:copy-of select="$content"/>
+      </xt:document>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 </xsl:stylesheet>