OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Incorrect XHTML generation?


Hi,

I'd be grateful for some advice from the list on the following issue:

I recently moved to generating XHTML output from some Docbook
documentation I wrote.  The version of Docbook was 4.2, using xsltproc
and the docbook-xsl-1.69.1 xhtml stylesheets to generate the XHTML.
However, this combination generated invalid XHTML.

On investigation, I found that the cause was using <cmdsynopsis>
within a <term> element of a <variablelist>.  The following Docbook sample
demonstrates the problem:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"/usr/share/sgml/docbook/xml-dtd-4.2-1.0-19/docbookx.dtd" >
<book>
  <bookinfo>
	<date>1st June, 2004</date>
	<title>Testing VariableList with cmdsynopsis</title>
	<authorgroup>
	  <author>
		<firstname>Mark</firstname>
		<surname>Willson</surname>
	  </author>
	</authorgroup>
  </bookinfo>
  <toc></toc>
  <preface id="preface">
	<title>Preface</title> 
	<para>
      Text
    </para>
  </preface>
  <chapter id="Test">
    <title>Test</title> 
    <para>
     Text.
    </para>
    <variablelist>
      <varlistentry id="b">
        <term> 
          <cmdsynopsis>
            <command>b</command> 
            <arg choice="plain">
              <replaceable>bufname</replaceable>
            </arg> 
            <group choice="req">
              <arg>
                <replaceable>size</replaceable>
              </arg>
              <arg>
                <replaceable>filename</replaceable>
              </arg>
            </group>
          </cmdsynopsis>
        </term> 
	<listitem>
          <para>
            A description.
          </para>
        </listitem>
      </varlistentry>
    </variablelist>
  </chapter>
</book>

The command I used was:

xsltproc -o xhtml/ ~/doc/docbook-xsl-1.69.1/xhtml/chunk.xsl test.xml

xsltproc generates the following XHTML fragment for the variable
list:

<div class="variablelist"><dl><dt><a id="b"></a><span class="term"> 
          <div class="cmdsynopsis"><p><code class="command">b</code>   
              <em class="replaceable"><code>bufname</code></em>
              {[
                <em class="replaceable"><code>size</code></em>
              ] |  [
                <em class="replaceable"><code>filename</code></em>
              ]}</p></div>
        </span></dt><dd><p>
            A description
          </p></dd></dl></div>

The problem is that neither <div> nor <p> are allowed within a <dt> element.

[Note, I also tried this with Docbook 4.4, but there was no difference].

I fixed this locally by modifying synop.xsl, removing the generation of
<div> and <p> for <cmdsynopsis>.  

Further, I note that in the 5.0 version of the Docbook book, cmdsynopsis is not
permitted within a term.

So, the question is:  Is this an error in the 1.69.1 stylesheets, or
am I misusing Docbook?

If the latter, do you have any advice on a better technique for the
description of a set of utility commands?

Many thanks,
Mark Willson


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]