在带有前缀的节点中进行 XPATH 查找 [英] XPATH lookup up in nodes with a prefix
本文介绍了在带有前缀的节点中进行 XPATH 查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个这样的 XML:
I have an XML like that:
<request type="POST">
<paths count="0"/>
<values count="9">
<Invoices1>123ABC</Invoices1>
<Invoices2>456EFG</Invoices2>
<Invoices3>789HIJ</Invoices3>
<Invoices4>012KLM</Invoices4>
<case_Email>Email</case_Email>
<case_Print>case_Print</case_Print>
<case_Fax>Fax</case_Fax>
<zone_TexteReponse>jkg</zone_TexteReponse>
<Editer>Editer</Editer>
</values>
我会使用 XSL 来转换此 XML,但我在使用标签 Invoicexxx 时遇到了困难.如何使用 XPath 选择它们:
I would use XSL to transform this XML but I'm struggling with the tag Invoicexxx. How can I select them with XPath:
/request/values/Invoices*
感谢您的帮助:-)
推荐答案
这是一种方法:
/request/values/*[starts-with(name(), 'Invoices')]
这篇关于在带有前缀的节点中进行 XPATH 查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文