我如何阅读此xml文件
<Subs>
<Sub Report="BusinessSummarySubs" EMails="lalla@yahoo.com; haha@yahoo.com">
<Sub Report="PlayerSubs" EMails="hehe@hotmail.com">
</Subs>
并将BusinesSummarySubs.txt中的@VARIABLE替换为
中的电子邮件值以下是BusinessSumarySubs.txt
的内容(部分内容)CType(extensionParams(0),ParameterValue).Name = "TO"
CType(extensionParams(0),ParameterValue).Label = ""
CType(extensionParams(0),ParameterValue).Value = "@VARIABLE"
答案 0 :(得分:0)
如果查看here,您将看到如何搜索和访问属性。如果您想获得用于下一个任务的最小XML处理脚本的框架,请点击指向'the same for text'的链接进行精神差异。
VBScript中的单个占位符替换很简单:只需使用替换:
>> attr = "lalla@yahoo.com; haha@yahoo.com"
>> content = "... .Value = ""@VARIABLE"" ..."
>> ph = "@VARIABLE"
>> WScript.Echo Replace(content, ph, attr)
>>
... .Value = "lalla@yahoo.com; haha@yahoo.com" ...
>>
答案 1 :(得分:-1)
像我这样的东西
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("note.xml")
for each Emails in xmlDoc.documentElement.childNodes
document.write(Emails .nodename)
document.write(": ")
document.write(Emails .text)
next