]> granicus.if.org Git - docbook-dsssl/commitdiff
Use the new chunking parameters: NOTE WELL: they are described in param.xweb but...
authorNorman Walsh <ndw@nwalsh.com>
Thu, 13 Jun 2002 11:03:00 +0000 (11:03 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 13 Jun 2002 11:03:00 +0000 (11:03 +0000)
xsl/html/chunker.xsl
xsl/html/manifest.xsl
xsl/html/math.xsl
xsl/html/param.ent
xsl/html/param.xweb

index f591c0d1752adb66f9344e069b3efeff46147d38..d77d05836a711c595a12c0b04402cfa8d3b5a5d9 100644 (file)
 <!-- exsl:document, saxon:output, or xalanredirect:write -->
 <!-- Note: Only Saxon 6.4.2 or later is supported. -->
 
+<xsl:param name="chunker.output.method" select="'html'"/>
+<xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
+<xsl:param name="chunker.output.indent" select="'no'"/>
+<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
+<xsl:param name="chunker.output.standalone" select="'no'"/>
+<xsl:param name="chunker.output.doctype-public" select="''"/>
+<xsl:param name="chunker.output.doctype-system" select="''"/>
+<xsl:param name="chunker.output.media-type" select="''"/>
+<xsl:param name="chunker.output.cdata-section-elements" select="''"/>
+
+<xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
+
 <!-- ==================================================================== -->
 
 <xsl:template name="make-relative-filename">
 
 <xsl:template name="write.chunk">
   <xsl:param name="filename" select="''"/>
-  <xsl:param name="method" select="$output.method"/>
-  <xsl:param name="encoding" select="$default.encoding"/>
-  <xsl:param name="indent" select="'no'"/>
-  <xsl:param name="content" select="''"/>
   <xsl:param name="quiet" select="0"/>
 
+  <xsl:param name="method" select="$chunker.output.method"/>
+  <xsl:param name="encoding" select="$chunker.output.encoding"/>
+  <xsl:param name="indent" select="$chunker.output.indent"/>
+  <xsl:param name="omit-xml-declaration"
+             select="$chunker.output.omit-xml-declaration"/>
+  <xsl:param name="standalone" select="$chunker.output.standalone"/>
+  <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
+  <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
+  <xsl:param name="media-type" select="$chunker.output.media-type"/>
+  <xsl:param name="cdata-section-elements"
+             select="$chunker.output.cdata-section-elements"/>
+
+  <xsl:param name="content"/>
+
   <xsl:if test="$quiet = 0">
     <xsl:message>
       <xsl:text>Writing </xsl:text>
       <exsl:document href="{$filename}"
                      method="{$method}"
                      encoding="{$encoding}"
-                     indent="{$indent}">
+                     indent="{$indent}"
+                     omit-xml-declaration="{$omit-xml-declaration}"
+                     standalone="{$standalone}">
+        <xsl:if test="$cdata-section-elements != ''">
+          <xsl:attribute name="cdata-section-elements">
+            <xsl:value-of select="$cdata-section-elements"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="$media-type != ''">
+          <xsl:attribute name="media-type">
+            <xsl:value-of select="$media-type"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="$doctype-public != ''">
+          <xsl:attribute name="doctype-public">
+            <xsl:value-of select="$doctype-public"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="$doctype-system != ''">
+          <xsl:attribute name="doctype-system">
+            <xsl:value-of select="$doctype-system"/>
+          </xsl:attribute>
+        </xsl:if>
+
         <xsl:copy-of select="$content"/>
       </exsl:document>
     </xsl:when>
                     method="{$method}"
                     encoding="{$encoding}"
                     indent="{$indent}"
+                    omit-xml-declaration="{$omit-xml-declaration}"
+                    standalone="{$standalone}"
                     saxon:character-representation="{$saxon.character.representation}">
+        <xsl:if test="$cdata-section-elements != ''">
+          <xsl:attribute name="cdata-section-elements">
+            <xsl:value-of select="$cdata-section-elements"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="$media-type != ''">
+          <xsl:attribute name="media-type">
+            <xsl:value-of select="$media-type"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="$doctype-public != ''">
+          <xsl:attribute name="doctype-public">
+            <xsl:value-of select="$doctype-public"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="$doctype-system != ''">
+          <xsl:attribute name="doctype-system">
+            <xsl:value-of select="$doctype-system"/>
+          </xsl:attribute>
+        </xsl:if>
         <xsl:copy-of select="$content"/>
       </saxon:output>
     </xsl:when>
 
 <xsl:template name="write.chunk.with.doctype">
   <xsl:param name="filename" select="''"/>
-  <xsl:param name="method" select="$output.method"/>
-  <xsl:param name="encoding" select="$default.encoding"/>
-  <xsl:param name="indent" select="'no'"/>
-  <xsl:param name="doctype-public" select="''"/>
-  <xsl:param name="doctype-system" select="''"/>
-  <xsl:param name="content" select="''"/>
   <xsl:param name="quiet" select="0"/>
 
-  <xsl:if test="$quiet = 0">
-    <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>
-  </xsl:if>
+  <xsl:param name="method" select="$chunker.output.method"/>
+  <xsl:param name="encoding" select="$chunker.output.encoding"/>
+  <xsl:param name="indent" select="$chunker.output.indent"/>
+  <xsl:param name="omit-xml-declaration"
+             select="$chunker.output.omit-xml-declaration"/>
+  <xsl:param name="standalone" select="$chunker.output.standalone"/>
+  <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
+  <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
+  <xsl:param name="media-type" select="$chunker.output.media-type"/>
+  <xsl:param name="cdata-section-elements"
+             select="$chunker.output.cdata-section-elements"/>
 
+  <xsl:param name="content"/>
 
-  <xsl:choose>
-    <xsl:when test="element-available('exsl:document')">
-      <exsl:document href="{$filename}"
-                     method="{$method}"
-                     encoding="{$encoding}"
-                     indent="{$indent}"
-                     doctype-public="{$doctype-public}"
-                     doctype-system="{$doctype-system}">
-        <xsl:copy-of select="$content"/>
-      </exsl:document>
-    </xsl:when>
-    <xsl:when test="element-available('saxon:output')">
-      <!-- Saxon uses saxon:output -->
-      <saxon:output href="{$filename}"
-                    method="{$method}"
-                    encoding="{$encoding}"
-                    indent="{$indent}"
-                    doctype-public="{$doctype-public}"
-                    doctype-system="{$doctype-system}"
-                    saxon:character-representation="{$saxon.character.representation}">
-        <xsl:copy-of select="$content"/>
-      </saxon:output>
-    </xsl:when>
-    <xsl:when test="element-available('xalanredirect:write')">
-      <!-- Xalan uses xalanredirect -->
-      <xalanredirect:write file="{$filename}">
-        <xsl:copy-of select="$content"/>
-      </xalanredirect:write>
-    </xsl:when>
-    <xsl:otherwise>
-      <!-- it doesn't matter since we won't be making chunks... -->
-      <xsl:message terminate="yes">
-        <xsl:text>Can't make chunks with </xsl:text>
-        <xsl:value-of select="system-property('xsl:vendor')"/>
-        <xsl:text>'s processor.</xsl:text>
-      </xsl:message>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:call-template name="write.chunk">
+    <xsl:with-param name="filename" select="$filename"/>
+    <xsl:with-param name="quiet" select="$quiet"/>
+    <xsl:with-param name="method" select="$method"/>
+    <xsl:with-param name="encoding" select="$encoding"/>
+    <xsl:with-param name="indent" select="$indent"/>
+    <xsl:with-param name="omit-xml-declaration" select="$omit-xml-declaration"/>
+    <xsl:with-param name="standalone" select="$standalone"/>
+    <xsl:with-param name="doctype-public" select="$doctype-public"/>
+    <xsl:with-param name="doctype-system" select="$doctype-system"/>
+    <xsl:with-param name="media-type" select="$media-type"/>
+    <xsl:with-param name="cdata-section-elements" select="$cdata-section-elements"/>
+    <xsl:with-param name="content" select="$content"/>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template name="write.text.chunk">
   <xsl:param name="filename" select="''"/>
+  <xsl:param name="quiet" select="0"/>
   <xsl:param name="method" select="'text'"/>
-  <xsl:param name="content" select="''"/>
-  <xsl:param name="encoding" select="'iso-8859-1'"/>
+  <xsl:param name="encoding" select="$chunker.output.encoding"/>
+  <xsl:param name="media-type" select="$chunker.output.media-type"/>
+  <xsl:param name="content"/>
+
   <xsl:call-template name="write.chunk">
     <xsl:with-param name="filename" select="$filename"/>
+    <xsl:with-param name="quiet" select="$quiet"/>
     <xsl:with-param name="method" select="$method"/>
-    <xsl:with-param name="content" select="$content"/>
     <xsl:with-param name="encoding" select="$encoding"/>
-    <xsl:with-param name="quiet" select="$chunk.quietly"/>
+    <xsl:with-param name="indent"/>
+    <xsl:with-param name="omit-xml-declaration"/>
+    <xsl:with-param name="standalone"/>
+    <xsl:with-param name="doctype-public"/>
+    <xsl:with-param name="doctype-system"/>
+    <xsl:with-param name="media-type" select="$media-type"/>
+    <xsl:with-param name="cdata-section-elements"/>
+    <xsl:with-param name="content" select="$content"/>
   </xsl:call-template>
 </xsl:template>
 
index 0c9e3edc993083548461b601848934212e8de444..73fff7ce04ca248114a35582dab9a7bc70746fd6 100644 (file)
@@ -11,7 +11,7 @@
     <xsl:with-param name="content">
       <xsl:apply-templates select="$node" mode="enumerate-files"/>
     </xsl:with-param>
-    <xsl:with-param name="encoding" select="$default.encoding"/>
+    <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
   </xsl:call-template>
 </xsl:template>
 
index 2af155f12507cabc62979792b82a8e33a7c1a726..2a136a7d7a0817d30980e50390af155b38822dee 100644 (file)
@@ -54,7 +54,7 @@
         </xsl:otherwise>
       </xsl:choose>
     </xsl:with-param>
-    <xsl:with-param name="encoding" select="$default.encoding"/>
+    <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
   </xsl:call-template>
 </xsl:template>
 
index 4f91e47d124dce52e8c9e83a3f632062e5b2e034..14414817572f69e80260eb8064ca8acc9be3764e 100644 (file)
 <!ENTITY chunk.quietly SYSTEM "../params/chunk.quietly.xml">
 <!ENTITY chunk.section.depth SYSTEM "../params/chunk.section.depth.xml">
 <!ENTITY chunk.toc SYSTEM "../params/chunk.toc.xml">
+<!ENTITY chunker.output.cdata-section-elements SYSTEM "../params/chunker.output.cdata-section-elements.xml">
+<!ENTITY chunker.output.doctype-public SYSTEM "../params/chunker.output.doctype-public.xml">
+<!ENTITY chunker.output.doctype-system SYSTEM "../params/chunker.output.doctype-system.xml">
+<!ENTITY chunker.output.encoding SYSTEM "../params/chunker.output.encoding.xml">
+<!ENTITY chunker.output.indent SYSTEM "../params/chunker.output.indent.xml">
+<!ENTITY chunker.output.media-type SYSTEM "../params/chunker.output.media-type.xml">
+<!ENTITY chunker.output.method SYSTEM "../params/chunker.output.method.xml">
+<!ENTITY chunker.output.omit-xml-declaration SYSTEM "../params/chunker.output.omit-xml-declaration.xml">
+<!ENTITY chunker.output.standalone SYSTEM "../params/chunker.output.standalone.xml">
 <!ENTITY citerefentry.link SYSTEM "../params/citerefentry.link.xml">
 <!ENTITY css.decoration SYSTEM "../params/css.decoration.xml">
-<!ENTITY default.encoding SYSTEM "../params/default.encoding.xml">
 <!ENTITY default.table.width SYSTEM "../params/default.table.width.xml">
 <!ENTITY draft.watermark.image SYSTEM "../params/draft.watermark.image.xml">
 <!ENTITY ebnf.table.bgcolor SYSTEM "../params/ebnf.table.bgcolor.xml">
 <!ENTITY olink.pubid SYSTEM "../params/olink.pubid.xml">
 <!ENTITY olink.resolver SYSTEM "../params/olink.resolver.xml">
 <!ENTITY olink.sysid SYSTEM "../params/olink.sysid.xml">
-<!ENTITY output.method SYSTEM "../params/output.method.xml">
 <!ENTITY part.autolabel SYSTEM "../params/part.autolabel.xml">
 <!ENTITY phrase.propagates.style SYSTEM "../params/phrase.propagates.style.xml">
 <!ENTITY pixels.per.inch SYSTEM "../params/pixels.per.inch.xml">
index ed9eee84288192ec0ef253415983731295548bac..22da79bd5126160121fe1ec7a6ad2ae3001fc2bc 100644 (file)
@@ -234,6 +234,16 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 </reference>
 
 <reference><title>Chunking</title>
+&chunker.output.cdata-section-elements;
+&chunker.output.doctype-public;
+&chunker.output.doctype-system;
+&chunker.output.encoding;
+&chunker.output.indent;
+&chunker.output.media-type;
+&chunker.output.method;
+&chunker.output.omit-xml-declaration;
+&chunker.output.standalone;
+&saxon.character.representation;
 &html.ext;
 &html.extra.head.links;
 &root.filename;
@@ -244,9 +254,6 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 &chunk.section.depth;
 &chunk.first.sections;
 &chunk.quietly;
-&saxon.character.representation;
-&default.encoding;
-&output.method;
 &chunk.datafile;
 &navig.graphics;
 &navig.graphics.extension;
@@ -348,7 +355,6 @@ around all these parameters.</para>
 <src:fragref linkend="chunk.toc.frag"/>
 <src:fragref linkend="citerefentry.link.frag"/>
 <src:fragref linkend="css.decoration.frag"/>
-<src:fragref linkend="default.encoding.frag"/>
 <src:fragref linkend="default.table.width.frag"/>
 <src:fragref linkend="draft.watermark.image.frag"/>
 <src:fragref linkend="ebnf.table.bgcolor.frag"/>
@@ -418,7 +424,6 @@ around all these parameters.</para>
 <src:fragref linkend="olink.pubid.frag"/>
 <src:fragref linkend="olink.resolver.frag"/>
 <src:fragref linkend="olink.sysid.frag"/>
-<src:fragref linkend="output.method.frag"/>
 <src:fragref linkend="part.autolabel.frag"/>
 <src:fragref linkend="phrase.propagates.style.frag"/>
 <src:fragref linkend="pixels.per.inch.frag"/>
@@ -452,7 +457,6 @@ around all these parameters.</para>
 <src:fragref linkend="rootid.frag"/>
 <src:fragref linkend="runinhead.default.title.end.punct.frag"/>
 <src:fragref linkend="runinhead.title.end.punct.frag"/>
-<src:fragref linkend="saxon.character.representation.frag"/>
 <src:fragref linkend="section.autolabel.frag"/>
 <src:fragref linkend="section.label.includes.component.label.frag"/>
 <src:fragref linkend="segmentedlist.as.table.frag"/>