QTP - 如何从 xml 文档中删除 XmlNode?
我想从 xml 文档中删除 xml 节点,但我不知道可以使用哪个函数来实现此目的。你能告诉我该怎么做吗?
Const XMLDataFile = "C:\TestData.xml"
xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)
nodes = xmlDoc.SelectNodes("/bookstore/book/author[text()='name=admin']")
' get their names
For i = 0 To (nodes.Length - 1)
Title = nodes(i).NodeValue
MsgBox("The node will be deleted " & Title)
'TODO: The expect code here
Next
I want remove an xml node from an xml document, but I don't know which function can be used to achieve that. Could you please tell me how to do that?
Const XMLDataFile = "C:\TestData.xml"
xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)
nodes = xmlDoc.SelectNodes("/bookstore/book/author[text()='name=admin']")
' get their names
For i = 0 To (nodes.Length - 1)
Title = nodes(i).NodeValue
MsgBox("The node will be deleted " & Title)
'TODO: The expect code here
Next
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上不是一个 QTP 问题,而是一个 XML 问题。
看看 MS 的文档 我想说以下内容可能会起作用
This isn't really a QTP question, it's an XML question.
Looking at MS's documentation I would say the following will probably work