--- Begin Message ---
- From: Norman Walsh <ndw at nwalsh dot com>
- To: John Ebbinghaus <ebbinghaus at tia dot dk>
- Date: 28 Nov 2001 09:42:57 -0500
- Subject: Re: Segmentedlist - help needed
- References: <000201c17812$e21f96b0$fe65a8c0@john>
- Xref: mercury archive.2001-11:16466
/ John Ebbinghaus <ebbinghaus@tia.dk> was heard to say:
| Any examples of how to display a segmentedlist as a table would be
| appreciated.
This'll do it for HTML:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
<xsl:template match="segmentedlist">
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="title"/>
<table border="0">
<thead>
<tr>
<xsl:apply-templates select="segtitle"/>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="seglistitem"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="segmentedlist/title">
<p><b><xsl:apply-templates/></b></p>
</xsl:template>
<xsl:template match="segtitle">
<th><xsl:apply-templates/></th>
</xsl:template>
<xsl:template match="seglistitem">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="seg">
<td><xsl:apply-templates/></td>
</xsl:template>
</xsl:stylesheet>
| I found the following statements in the descriptions for children of
| segmentedlist:
| "Each Seg is a cell in the body of the table"
| "Each SegListItem is a row in the table"
| "Each SegTitle is a column heading"
| "The first SegTitle goes with the first Seg in each SegListItem, the
| second with the second..."
|
| Which is fine if one had but an example.
<segmentedlist><title>State Capitals</title>
<segtitle>State</segtitle>
<segtitle>Capital</segtitle>
<seglistitem><seg>Alabama</seg><seg>Montgomery</seg></seglistitem>
<seglistitem><seg>Alaska</seg><seg>Anchorage</seg></seglistitem>
<seglistitem><seg>Arkansas</seg><seg>Little Rock</seg></seglistitem>
</segmentedlist>
:-)
| Am I stuck with a work-around, and if so, for how long? I would have
| thought that DocBook, being THE framework for technical
| documentation, would have this indispensable list type in place long
| ago... So much of technical documentation IS lists such as these!
I don't believe I have ever seen this type used. If you have some real
examples, I'd love to see them.
Be seeing you,
norm
P.S. I'll add a parameter to format segmented lists as tables for the next
release.
--
Norman Walsh <ndw@nwalsh.com> | I'm NOT in denial!
http://www.oasis-open.org/docbook/ |
Chair, DocBook Technical Committee |
--- End Message ---