Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.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 if_Xml_Xslt_Compare - Fatal编程技术网

Xml 带标记名的XSL if

Xml 带标记名的XSL if,xml,xslt,compare,Xml,Xslt,Compare,我想使用XSL比较XML标记名 例如: <name> <item> TEST </item> <out> No item </out> </name> 试验 没有项目 想知道我是否在中。 在XSL中(例如,我不知道如何做,但这是我的想法): 请尝试以下代码 <xsl:for-each select="//*"> <xsl:if test="n

我想使用XSL比较XML标记名 例如:

<name>
  <item>
     TEST
  </item>
  <out>
     No item
  </out>
</name>

试验
没有项目
想知道我是否在
中。 在XSL中(例如,我不知道如何做,但这是我的想法):


请尝试以下代码

    <xsl:for-each select="//*">
        <xsl:if test="name(.)='item'">
            <xsl:value-of select="." />         
        </xsl:if>    
    </xsl:for-each>

    <xsl:for-each select="//*">
        <xsl:if test="name(.)='item'">
            <xsl:value-of select="." />         
        </xsl:if>    
    </xsl:for-each>