Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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 未触发XSLT模式_Xml_Xslt_Mode - Fatal编程技术网

Xml 未触发XSLT模式

Xml 未触发XSLT模式,xml,xslt,mode,Xml,Xslt,Mode,我尝试使用xslt模板匹配和模式功能,根据条件运行特定模板。在这种情况下,是否将admin设置为true <xsl:template match="*[//Properties[@Admin='true']]" mode="admin"> <!-- i get here --> <apply-templates select="self::node()[not(../PersonalisedErrorInstance)]" mode="persona

我尝试使用xslt模板匹配和模式功能,根据条件运行特定模板。在这种情况下,是否将
admin
设置为
true

<xsl:template match="*[//Properties[@Admin='true']]" mode="admin">
    <!-- i get here -->
    <apply-templates select="self::node()[not(../PersonalisedErrorInstance)]" mode="personalisation"/>
</xsl:template>

<xsl:template match="*[//Properties[@Admin='false']]" mode="admin">
    <apply-templates select="self::node()" mode="personalisation"/>
</xsl:template>

<xsl:template match="*" mode="personalisation">
    <!-- never get here -->

出于某种原因,我似乎从未点击过个性化模板匹配,无论
admin
true
还是
false
。是否有明显的事情表明我做错了


我已尝试将
self::node()
更改为
*
,因此我不确定是什么导致了问题

*
表示任何子实体,不能替换
self::node()

如果您提供源XML,我们可能会发现您的问题。可能是当前节点有一个同级实例
PersonalisedErrorInstance

致意
Majo

您忘记了应用模板中的前导
xsl:
<代码>应该能正常工作,我想。@potame叹息。。。哈哈,我已经盯着它看了好几个小时了。谢谢射杀自己