Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml XSL-检查第一个列表项是否为<;br/>;标签_Xml_Xslt_Apache Fop - Fatal编程技术网

Xml XSL-检查第一个列表项是否为<;br/>;标签

Xml XSL-检查第一个列表项是否为<;br/>;标签,xml,xslt,apache-fop,Xml,Xslt,Apache Fop,这是我的.xml文件 <list type="point"> <listitem> <text> <br/> <br/> . . . &l

这是我的.xml文件

    <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>