Xml XSL-检查第一个列表项是否为<;br/>;标签
这是我的.xml文件Xml XSL-检查第一个列表项是否为<;br/>;标签,xml,xslt,apache-fop,Xml,Xslt,Apache Fop,这是我的.xml文件 <list type="point"> <listitem> <text> <br/> <br/> . . . &l
<list type="point">
<listitem>
<text>
<br/>
<br/>
.
.
.
</text>
</listitem>
</list>
亲切问候您当前的表达方式是
<xsl:when test=".//list/listitem[1]/[*node*]">
或者,您可以尝试将表达式简化为
<xsl:when test="position() = 1 and */br">
请公布预期结果。谢谢。您能澄清一下“listitem是一个
标记”是什么意思吗。listitem始终是一个
标记。您的意思是要检查listitem是否有一个
标记作为后代?谢谢。@TimC我指的是列表项的第二级子项,很抱歉这是一个非常错误的表达。
<xsl:when test=".//list/listitem[1]/[*node*]">
<xsl:when test="not(preceding-sibling::listitem) and */br">
<xsl:when test="position() = 1 and */br">
<xsl:template match="list">
<xsl:apply-templates select="listitem" />
</xsl:template>