0

How i can read this xml file

<Subs>
  <Sub Report="BusinessSummarySubs" EMails="[email protected]; [email protected]">
  <Sub Report="PlayerSubs" EMails="[email protected]">
</Subs>

and replace @VARIABLE in BusinesSummarySubs.txt with EMails value in

Here is the content(part of the content) from BusinessSumarySubs.txt

CType(extensionParams(0),ParameterValue).Name = "TO"
CType(extensionParams(0),ParameterValue).Label = ""
CType(extensionParams(0),ParameterValue).Value = "@VARIABLE"
2
  • can anybody help me ? Commented Oct 15, 2014 at 12:26
  • Do you know how to read an XML file via VBScript? Commented Oct 15, 2014 at 13:17

2 Answers 2

0

If you look here, you'll see how to search for and to access attributes. Follow the link chain to 'the same for text' and do a mental diff, if you want to get a skeleton for a minimal XML processing script to use for your next task.

Single placeholder substitution in VBScript is easy: just use Replace:

>> attr = "[email protected]; [email protected]"
>> content = "... .Value = ""@VARIABLE"" ..."
>> ph = "@VARIABLE"
>> WScript.Echo Replace(content, ph, attr)
>>
... .Value = "[email protected]; [email protected]" ...
>>
Sign up to request clarification or add additional context in comments.

Comments

-1

Something like this i suposed

   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

1 Comment

"plot" not used, no Set when assigning to objNodeList, trying to get an attribute (EMails) via the .text property.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.