我想获取所有节点的值,这些值是“名称”之后的名称。但似乎 Nant xmlpeek 只能从 xml 中获取一个节点。有没有其他方法可以获取“名称”之后的所有节点?
xml文件:
<?xml version="1.0" encoding="utf-8" ?>
<QAEnvironment xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<user>
<name value="clientA" />
<name value="clientB" />
<name value="clientC" />
<name value="clientD" />
</user>
</QAEnvironment>
==================================================== ==============================
南特脚本:
<xmlpeek
file="A.xml"
xpath="/x:QAEnvironment/x:user/x:name/@value"
property="clientName"
nodeindex="3">
<namespaces>
<namespace prefix="x" uri="http://schemas.microsoft.com/developer/msbuild/2003" />
</namespaces>
<echo message="clientName: ${clientName}" />
</xmlpeek>
==================================================== ============================= 结果 - clientName: clientD (as nodindex = "3")
谢谢