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]

DocBook slides and XHTML validation


Hi 

I've been using DocBook slides. I'm attempting to get valid XTHML 1.0
Transitional as I want to use MathML and SVG.

I've been able to get Norm's demo slides to validate as XHTML 1.0 
with some fixes to the slides stylesheets (submitted at sourceforge).
But I'm stuck on something ...

Some of the slides examples use frames - actually the most appealing 
(IMHO) together with Dan York's CSS
http://www.lodestar2.com/people/dyork/talks/2002/ols/docbook-tutorial/frames/frames.html

In getting the frame based slides to validate I've modified
slides/xsl/xhtml/frames.xsl (tsk, tsk, didnt you see the comment :-)),
which is a tranformation from slides/xsl/html/frames.xsl using
html2xhtml.xsl.

The modifications include using a frameset doctype for those chunks
which include framesets - necessary for validation. I've gone about
it as follows in slides/xsl/xhtml/frames.xsl:

<xsl:template name="doctype-public">
  <xsl:param name="frameset" select="0"/>
  <xsl:choose>
    <xsl:when test="$frameset != 0">
      <xsl:text>-//W3C//DTD XHTML 1.0 Frameset//EN</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>-//W3C//DTD XHTML 1.0 Transitional//EN</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

(and likewise for doctype-system).

In <xsl:template match="slides"> I've inserted calls to the 
doctype templates:

  <xsl:variable name="doctype-system">
    <xsl:call-template name="doctype-system">
      <xsl:with-param name="frameset" select="1"/>
    </xsl:call-template>
  </xsl:variable>

and I've modified the relevant calls to write.chunk to include the
doctype parameters. Not sure if reusing names is frowned upon,
but its just draft anyway.

Not sure if the above is reasonable, but I'm now looking at how best
to fold the changes back into slides/xsl/html/frames.xsl so that it
all unfolds nicely.

The matter I'm snagged on is that for the HTML slide stylesheets we
may not want to write doctypes - unlike XHTML where they need to be
there (right?). So to handle both HTML and XHTML I need to
conditionally set the doctype for calls to write.chunk.

I havent been able to find any clean way of testing method='html'.  It
seems there is no accesible global setting. In the slides the output
method is not set in frames.xsl but in slides-common.xsl which is
imported. Using
document('slides-common.xsl')//xsl:output[ at method='xml'] in frames.xsl
seems to work but doesnt feel right.

Does it make sense to use the chunker parameters as the basis of
conditional tests as to whether doctypes are to be output, and to
conditionaly set the doctypes to framesets in calls to write.chunk as
appropriate?

At present the chunker doctype parameters arent modified by
html2xhtml.xsl, and I'm seeking advice about that too (also in another
related post).

Geoff



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