<orderedlist type="manual">
<item num="8. (1)">
<para id="t2_HKWB-S2-1.1_pgfId-135">What is your present estimate of the length of trial?</para>
</item>
<item num="(2)">
<para id="t2_HKWB-S2-1.1_pgfId-136">What is the earliest date that you believe you can be ready for trial?</para>
</item>
</orderedlist>
这是一个有点棘手的问题,首先是数字 8。 (1) 应该被拆分。8 应该在有序列表中,然后 1 和 2 应该在同一个有序列表(嵌套)中,在主有序列表下,请告诉我如何实现这一点。
我已经在尝试使用 xsl,如下所示。
<xsl:template name="orderedlist" match="orderedlist">
<ol class="eng-orderedlist orderedlist">
<xsl:apply-templates/>
</ol>
</xsl:template>
<xsl:template name="orderitem" match="item">
<li class="item">
<xsl:apply-templates/>
</li>
</xsl:template>
<xsl:template name="orderitempara" match="item/para">
<div class="para">
<xsl:choose>
<xsl:when test="position()=1">
<span class="item-num">
<xsl:if test="position()=1">
<xsl:value-of select="parent::item[1]/@num"/>
</xsl:if>
</span>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
但我得到的输出如下:
8. (1)What is your present estimate of the length of trial?
(2)What is the earliest date that you believe you can be ready for trial?
应该看起来像这样。
8 (1)What is your present estimate of the length of trial?
(2)What is the earliest date that you believe you can be ready for trial?
谢谢