Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能告诉我如何从该文件中获取名称属性的 xpath:
<asmv1:assembly xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"> <assemblyIdentity name="MyName"/> </asmv1:assembly>
我正在尝试为 nant xmlpoke 任务获取它,但没有成功。
谢谢。
这应该可以解决问题:
//asmv1:assembly/asmv1:assemblyIdentity/@name
试试这个 XPath
/*[local-name()='assembly']/assemblyIdentity/@name