Added <description> element for description lists
authorarjen <arjen>
Tue, 19 Aug 2003 06:33:19 +0000 (06:33 +0000)
committerarjen <arjen>
Tue, 19 Aug 2003 06:33:19 +0000 (06:33 +0000)
doc.dtd
html.xsl
latex.xsl

diff --git a/doc.dtd b/doc.dtd
index 72da6bf..a5e83e9 100644 (file)
--- a/doc.dtd
+++ b/doc.dtd
@@ -1,6 +1,6 @@
-<!ENTITY % inline "#PCDATA | emph | strong | code | remark | sub | sup | label | ref | page | reference | newline | newpage | LaTeX">
+<!ENTITY % inline "#PCDATA | emph | strong | code | remark | sub | sup | label | ref | page | reference | index | newline | newpage | LaTeX">
 
-<!ENTITY % block "para | quote | itemize | enumerate | verbatim | footnote | picture | include | table">
+<!ENTITY % block "para | quote | itemize | enumerate | description | verbatim | footnote | picture | include | table">
 
 <!ELEMENT doc (book | article | report)>
 <!ATTLIST doc
 <!ELEMENT quote (%inline;|%block;)*>
 <!ELEMENT itemize (item)*>
 <!ELEMENT enumerate (item)*>
+<!ELEMENT description (item)*>
 <!ELEMENT item (%inline;|%block;)*>
+<!ATTLIST item
+       tag     CDATA    #IMPLIED
+>
 <!ELEMENT verbatim (#PCDATA)>
 <!ELEMENT footnote (%inline;)*>
 
@@ -66,6 +70,8 @@
    name   ID     #REQUIRED
 >
 
+<!ELEMENT index (#PCDATA)>
+
 <!ELEMENT ref (%inline;)*>
 <!ATTLIST ref
    to     IDREF  #REQUIRED
index 7e5191d..828bc8e 100644 (file)
--- a/html.xsl
+++ b/html.xsl
 </ol>
 </xsl:template>
 
-<xsl:template match="item">
+<xsl:template match="description">
+<dl>
+   <xsl:apply-templates/>
+</dl>
+</xsl:template>
+
+<xsl:template match="itemize/item">
+<li>
+   <xsl:apply-templates/>
+</li>
+</xsl:template>
+
+<xsl:template match="enumerate/item">
 <li>
    <xsl:apply-templates/>
 </li>
 </xsl:template>
 
+<xsl:template match="description/item">
+<dt><xsl:value-of select='@tag'/></dt>
+<dd>
+   <xsl:apply-templates/>
+</dd>
+</xsl:template>
+
 <xsl:template match="footnote">
 <sup><a>
   <xsl:attribute name='href'>#footnote<xsl:number level='any'/></xsl:attribute>
    </xsl:attribute></a>
 </xsl:template>
 
+<xsl:template match="index"></xsl:template>
+
 <xsl:template match="ref">
    <a><xsl:attribute name='href'>#<xsl:value-of select="@to"/></xsl:attribute>
      <xsl:apply-templates/>
-     <xsl:apply-templates select="id(@to)" mode="section-number"/>
+     <!--<xsl:apply-templates select="id(@to)" mode="section-number"/>-->
    </a>
 </xsl:template>
 
index 4e99d0b..566bb4b 100644 (file)
--- a/latex.xsl
+++ b/latex.xsl
 \end{enumerate}
 </xsl:template>
 
-<xsl:template match="item">
+<xsl:template match="description">
+\begin{description}
+   <xsl:apply-templates/>
+\end{description}
+</xsl:template>
+
+<xsl:template match="itemize/item">
+\item <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="enumerate/item">
 \item <xsl:apply-templates/>
 </xsl:template>
 
+<xsl:template match="description/item">
+\item[<xsl:value-of select='@tag'/>] <xsl:apply-templates/>
+</xsl:template>
+
 <xsl:template match="footnote">\footnote{<xsl:apply-templates/>}</xsl:template>
 
 <xsl:template match="emph">\begin{itshape}<xsl:apply-templates/>\end{itshape}</xsl:template>
 
 <xsl:template match="label">\label{<xsl:value-of select="@name"/>}</xsl:template>
 
+<xsl:template match="index"></xsl:template>
 <xsl:template match="ref"><xsl:apply-templates/>\ref{<xsl:value-of select="@to"/>}</xsl:template>
 <xsl:template match="page"><xsl:apply-templates/>\pageref{<xsl:value-of select="@to"/>}</xsl:template>
 <xsl:template match="reference">