xpath内部链接解析
我从一个Web服务得到一个soap响应,它看起来像这样:xpath内部链接解析,xpath,vbscript,xml-parsing,qtp,Xpath,Vbscript,Xml Parsing,Qtp,我从一个Web服务得到一个soap响应,它看起来像这样: <?xml version="1.0" encoding="UTF-8"?> <Body> <multiref id="1"> <cpuclock>2300</cpuclock> <memoryComponent> <item href="#2"/> <item href="#3"/> <
<?xml version="1.0" encoding="UTF-8"?>
<Body>
<multiref id="1">
<cpuclock>2300</cpuclock>
<memoryComponent>
<item href="#2"/>
<item href="#3"/>
</memoryComponent>
</multiref>
<multiref id="2" type="ns2:MemoryComponent">
<type>RAM</type>
<quantity>2048</quantity>
</multiref>
<multiref id="3" type="ns3:MemoryComponent">
<type>RAM</type>
<quantity>1024</quantity>
</multiref>
</Body>
2300
内存
2048
内存
1024
我试图实现的是恢复memoryComponent元素。
因为我使用的是VBScript/QTP的XMLUtil,所以我一直在尝试使用XPATH(通过谓词)解决问题。my QTP framework版本不支持以结束。
有什么建议吗
蒂亚 我找到了一种检索我想要的元素的方法
Set childElements = XMLFile.ChildElementsByPath("/Body/multiref[contains(@type,'MemoryComponent')]")
这个变通方法非常适合我的需要。
谢谢 如果你想让我们帮助你的代码,你需要先显示你的代码。