gpt4 book ai didi

xpath - MS XML selectNodes 方法未返回预期节点

转载 作者:行者123 更新时间:2023-12-02 17:40:00 24 4
gpt4 key购买 nike

VB6 代码(XML 文件)

我的Xml文件如下

<book>
<name>x1</name>
<price>1<price>
<name>x2</name>
<name>x3</name>
<price>2<price>
</book>

根节点是书

Set nodlist = xmlDoc.selectNodes("/Book/Price")

仅选择 1 个节点,其余节点被忽略

我想获取所有名为 price 的节点。

最佳答案

Set nodlist = xmlDoc.selectNodes("/Book/Price")

XPath 是 CAse senSitiVe —— 在提供的 XML 文档中没有名为 BookPrice 的节点。因此,上述方法调用必须返回一个空的 XmlNodeList

你想要:

Set nodlist = xmlDoc.selectNodes("/book/price")

关于xpath - MS XML selectNodes 方法未返回预期节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10959655/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com