mathiaso
asked on
VB script to add element in XML
I have an XML file with attributes. I want to add elements to this with VB script.
As an example I want to add this element to my example XML file.
As an example I want to add this element to my example XML file.
<category name="OP\Monofilter\100\Median">
<setting name="radius" type="string" value="1" />
Example XML<?xml version="1.0"?>
<OPsettings version="1.0">
...
<category name="OP\ListMonofilter">
<setting name="1" type="string" value="Pan" />
</category>
<category name="OP\Monofilter\1\Histogram">
<setting name="Monomatic" type="boolean" value="1" />
<setting name="low" type="string" value="0.001" />
<setting name="high" type="string" value="1" />
<setting name="gamma" type="string" value="1" />
</category>
</OPSettings>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In vbscript you can insert the CR and LF characters to a string like follows:
xml2.loadXML "<category name=""OP\Monofilter\100\Median"">" & vbCrLf & "<setting name=""radius"" type=""string"" value=""1000"" />" & vbCrLf & "</category>"
ASKER