version='1.0'>
<xsl:template match="para|simpara|remark" mode="list">
- <xsl:variable name="foo">
- <xsl:apply-templates/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($foo)"/>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <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:when>
+ <xsl:when test="self::text()">
+ <xsl:if test="starts-with(translate(.,' ',' '), ' ') and
+ preceding-sibling::node()[name(.)!='']">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:variable name="content">
+ <xsl:apply-templates select="."/>
+ </xsl:variable>
+ <xsl:value-of select="normalize-space($content)"/>
+ <xsl:if
+ test="translate(substring(., string-length(.), 1),' ',' ') = ' '
+ and following-sibling::node()[name(.)!='']">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="content">
+ <xsl:apply-templates select="."/>
+ </xsl:variable>
+ <xsl:value-of select="normalize-space($content)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
<xsl:text> </xsl:text>
- <xsl:if test="following-sibling::para or following-sibling::simpara or
- following-sibling::remark">
+
+ <xsl:if test="following-sibling::para or
+ following-sibling::simpara or
+ following-sibling::remark">
<!-- Make sure multiple paragraphs within a list item don't -->
<!-- merge together. -->
<xsl:text> </xsl:text>
<xsl:template match="itemizedlist/listitem">
<xsl:text>\(bu </xsl:text>
- <xsl:variable name="content">
- <xsl:apply-templates mode="list"/>
- </xsl:variable>
- <xsl:value-of select="normalize-space($content)"/>
+ <xsl:apply-templates mode="list"/>
<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:text> .RS .TP 3 </xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>.LP .RE </xsl:text>
+</xsl:template>
+
</xsl:stylesheet>