使用vbscript在XML中搜索字符串 [英] Search string in XML using vbscript
问题描述
我希望让vbscript从其中一个表列(CLOB类型)加载soap xml文件。在这个xml中,我们正在搜索父标签中的子标签下的字符。
以下是结构:
soap:envelope / msg: payload / soi:formsubmitted / soi:form / soi:associatedactivity / soi:activity / ns5 / dkcus / dkcomment /
Under< dkcomment>标签我们正在搜索'字符。
如果它存在,删除文件,否则保持原样。
这里的缺点是我们正在更新vb脚本因此只需要vb脚本。依赖是使用notepad ++,VS 2013/15。
请建议使用什么IDE?
我尝试过:
我尝试过使用Visual Basic 2008.
使用XPath / DOM解析VBScript中的XML: XML文件 - XML教程 - Microsoft XML解析器 [ ^ ]
从XML文档中提取XML元素的一种非常常见的方法是遍历节点三并提取每个元素的文本值。可以编写一小段编程代码,例如VBScript for / each构造来演示这一点。
以下VBScript代码遍历XML节点树,并显示XML浏览器中的元素:
set xmlDoc = CreateObject( Microsoft.XMLDOM)
xmlDoc.async = false
xmlDoc.load( note.xml )
每个 x in xmlDoc.documentElement.childNodes
document.write(x.nodename)
document.write( < span class =code-string>:)
document.write(x.text)
next
I am looking to get vbscript to load soap xml file from one of the table columns (CLOB type). In this xml, we are searching for ' character under a child tag within parent tags.
Below is structure:
soap:envelope/msg:payload/soi:formsubmitted/soi:form/soi:associatedactivity/soi:activity/ns5/dkcus/dkcomment/
Under <dkcomment> tag we are searching for ' character.
If it is present, delete the file else keep as it is.
Drawback here is we are updating vb script hence require vb script only for this. Dependency is with notepad++, VS 2013/15.
please suggest what IDE to use?
What I have tried:
I have tried using Visual Basic 2008.
Use XPath / DOM for parsing XML in VBScript: XML Files - XML Tutorial - Microsoft XML Parser[^]
One very common way to extract XML elements from an XML document is to traverse the node three and extract the text value of each elements. A small snippet of programming code like a VBScript for/each construct can be written to demonstrate this.
The following VBScript code traverses an XML node tree, and displays the XML elements in the browser:
set xmlDoc=CreateObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load("note.xml") for each x in xmlDoc.documentElement.childNodes document.write(x.nodename) document.write(": ") document.write(x.text) next
这篇关于使用vbscript在XML中搜索字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!