This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
RE: Newbie troubles with Docbook/XML + XHTML
- From: Jeff Beal <jeff dot beal at ansys dot com>
- To: 'John Levon' <levon at movementarian dot org>, docbook-apps at lists dot oasis-open dot org
- Date: Fri, 03 May 2002 08:32:54 -0400
- Subject: RE: DOCBOOK-APPS: Newbie troubles with Docbook/XML + XHTML
<!-- this will give you the doctype on your chunks -->
Unfortunately, the <xsl:output> element does not control the output through
the chunking facility. If you look in the file "chunker.xsl" in the XHTML,
you'll see two templates: write.chunk and write.chunk.with.doctype. The
template 'process.chunk' in chunk.xsl calls write.chunk (i.e. without
doctype). Unfortunately, there is not a parameter to control this behavior.
However, you can write a customization template to handle this (note that I
didn't get the XHTML DOCTYPE - I'm too lazy to look it up, and I don't have
it memorized)
<xsl:template name="process-chunk">
<xsl:param name="prev" select="."/>
<xsl:param name="next" select="."/>
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:variable name="chunkfn">
<xsl:if test="$ischunk='1'">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:if>
</xsl:variable>
<xsl:if test="$ischunk='0'">
<xsl:message>
<xsl:text>Error </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text> is not a chunk!</xsl:text>
</xsl:message>
</xsl:if>
<xsl:variable name="filename">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir" select="$base.dir"/>
<xsl:with-param name="base.name" select="$chunkfn"/>
</xsl:call-template>
</xsl:variable>
<!-- This adds the XHTML DOCTYPE declaration-->
<xsl:call-template name="write.chunk.with.doctype">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="doctype-public">Insert XHTML Public DOCTYPE
here</xsl:with-param>
<xsl:with-param name="doctype-system">Insert XHTML System DOCTYPE
here</xsl:with-param>
<xsl:with-param name="content">
<xsl:call-template name="chunk-element-content">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>