下面是我的源XML,我需要得到DOC_ID哪里doc_tag等于“交付”。在下面的例子中,我需要DOC_ID为123654789的doc_tag等于交割,我尝试过各种X路径,但我可以在doc_tag可交付不完全针点
任何帮助深表感谢。
谢谢 Venk
<?xml version="1.0" encoding="UTF-8"?>
<root>
<document>
<doc_id>321654987</doc_id>
<doc_tag>Log</doc_tag>
</document>
<document>
<doc_id>123654789</doc_id>
<doc_tag>deliverable</doc_tag>
</document>
<document>
<doc_id>325698741</doc_id>
<doc_tag>Log2</doc_tag>
</document>
<document>
<doc_id>369852147</doc_id>
<doc_tag>nondeliverable</doc_tag>
</document>
</root>
如果你想获得的价值,当你在文档节点匹配模板
<xsl:template match="/">
<xsl:value-of select="root/document[doc_tag='deliverable']/doc_id" />
</xsl:template>
在方括号表示在其上选择document
元件应该被过滤的条件。