<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
-<xsl:template match="para|simpara|remark" mode="list">
+<xsl:template match="para[ancestor::listitem or ancestor::step]|
+ simpara[ancestor::listitem or ancestor::step]|
+ remark[ancestor::listitem or ancestor::step]">
<xsl:for-each select="node()">
<xsl:choose>
- <xsl:when test="self::literallayout|self::screen|self::programlisting|self::itemizedlist|self::orderedlist|self::variablelist">
+ <xsl:when test="self::literallayout|self::screen|self::programlisting|
+ self::itemizedlist|self::orderedlist|self::variablelist">
<xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="list"/>
+ <xsl:apply-templates select="."/>
</xsl:when>
<xsl:when test="self::text()">
<xsl:if test="starts-with(translate(.,' ',' '), ' ') and
<xsl:apply-templates/>
</xsl:template>
-<xsl:template match="variablelist|glosslist" mode="list">
+<xsl:template match="variablelist[ancestor::listitem or ancestor::step]|
+ glosslist[ancestor::listitem or ancestor::step]">
<xsl:text> .RS </xsl:text>
<xsl:apply-templates/>
<xsl:text> .RE </xsl:text>
<xsl:template match="varlistentry/listitem|glossdef">
<xsl:text> </xsl:text>
- <xsl:apply-templates mode="list"/>
+ <xsl:apply-templates/>
</xsl:template>
<xsl:template match="itemizedlist/listitem">
<xsl:text>\(bu </xsl:text>
- <xsl:apply-templates mode="list"/>
+ <xsl:apply-templates/>
<xsl:if test="position()!=last()">
<xsl:text>.TP </xsl:text>
</xsl:if>
<xsl:template match="orderedlist/listitem|procedure/step">
<xsl:number format="1."/>
<xsl:text> </xsl:text>
- <xsl:apply-templates mode="list"/>
+ <xsl:apply-templates/>
<xsl:if test="position()!=last()">
<xsl:text>.TP </xsl:text>
</xsl:if>
<xsl:text>.LP </xsl:text>
</xsl:template>
-<xsl:template match="itemizedlist|orderedlist|procedure" mode="list">
+<xsl:template match="itemizedlist[ancestor::listitem or ancestor::step]|
+ orderedlist[ancestor::listitem or ancestor::step]|
+ procedure[ancestor::listitem or ancestor::step]">
<xsl:text> .RS .TP 3 </xsl:text>
<xsl:apply-templates/>
<xsl:text>.LP .RE </xsl:text>