This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

doctype and local subset in chunked (x)html output fromdbxsl


I'd like to know if it would be possible to agree on a change to the
(x)html xslt stylesheets to allow easy customization of the chunked output
prolog stuff like doctype or indenting?

While it is already customizable by overridung xsl:output for unchunked
output, it is at present IMHO impossible for chunking.

What I'm thinking of are parameters like $output.doctype-public,
$output.doctype-system and $output.indent in addition to the already
present $output.method. (Talking about docbook-xsl-1.48.)

One solution could be to use their values as default values for the
parameters of the named template write.chunk.with.doctype. Then substitute
the call of write.chunk with write.chunk.with.doctype in the named
template process-chunk within chunk.xsl. Maybe there are some more places
that need substitution (legalnotice with titlepage.mode in titlepage.xsl,
write.longdesc in graphics.xsl (ignoring chunk-experimental.xsl and
oldchunker.xsl))?

For those of us who still don't want to have a doctype declaration in
their output, do we need one more parameter as an on/off switch or is it
sufficient to assign an empty string to both $output.doctype-public and
$output.doctype-system?

But what if one needs a local DTD subset in his/her output? An example
case would be a docbook document using the mathml module and containing
MathML markup with a namespace prefix of 'mml'. The stylesheets just pass
the nodes through. To get valid output with xhtml (only for xml-output
MathML makes sense, i.e. not for html) the usage of a namespace prefix has
to be declared in a local subset [mathml2, xhtml modularization]:

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
           "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"; [
    <!ENTITY % MATHML.prefixed "INCLUDE">
    <!ENTITY % MATHML.prefix "mml">
]>

Inspired by calc-chunks.xsl I tried the following code fragment at the
beginning of chunk-element-content within chunk.xsl:

  <xsl:text disable-output-escaping="yes">
    <!-- HACK! -->
&lt;!DOCTYPE html PUBLIC "</xsl:text><xsl:value-of
select="$output.doctype-public"/><xsl:text disable-output-escaping="yes">"
         "</xsl:text><xsl:value-of
select="$output.doctype-system"/><xsl:text disable-output-escaping="yes">"
[ 
  ...
]&gt;
</xsl:text>

Somehow it worked but it looks not very clean to me. Unfortunately this
even collides with write.chunk.with.doctype because the xslt engine must
not generate a doctype declaration itself now.

BTW, am I going to far with this? We still output xhtml 1.0 transitional
(or pretend to do so ;-)) not even xhtml 1.1 so the modularization stuff
doesn't apply? At least Mozilla renders the equations because the
namespace is declared on the mml root element and the namespace is all it
cares about (and wellformedness of course).


Steffen.

-- 
  http://w3studi.informatik.uni-stuttgart.de/~maiersn/
mailto:Steffen.Maier@studserv.uni-stuttgart.de

proposed diffs:

--- chunker.xsl~	Thu Jan 31 10:58:02 2002
+++ chunker.xsl	Thu Jan 31 11:23:48 2002
@@ -98,9 +98,9 @@
   <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="indent" select="$output.indent"/>
+  <xsl:param name="doctype-public" select="$output.doctype-public"/>
+  <xsl:param name="doctype-system" select="$output.doctype-system"/>
   <xsl:param name="content" select="''"/>
 
   <xsl:message>

--- chunk.xsl~	Thu Jan 31 10:58:00 2002
+++ chunk.xsl	Thu Jan 31 11:22:57 2002
@@ -713,7 +713,7 @@
     </xsl:call-template>
   </xsl:variable>
 
-  <xsl:call-template name="write.chunk">
+  <xsl:call-template name="write.chunk.with.doctype">
     <xsl:with-param name="filename" select="$filename"/>
     <xsl:with-param name="content">
       <xsl:call-template name="chunk-element-content">


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]