PDA

View Full Version : Write elements into XML


teognost
10-09-2013, 12:58 PM
Hi
I have a list of elements -like {Accounting.Iface;Accounting.Service} which are read one by one in a loop step (separator is ; ) and then I need to write every element in a XML file like below(ModuleMask value is the current element):

<Filters>
<IncludeFilters>
<FilterEntry>
<ModuleMask>Accounting.Iface</ModuleMask>
<ClassMask>*</ClassMask>
<FunctionMask>*</FunctionMask>
</FilterEntry>
<FilterEntry>
<ModuleMask>Accounting.Service</ModuleMask>
<ClassMask>*</ClassMask>
<FunctionMask>*</FunctionMask>
</FilterEntry>
</IncludeFilters>

I tried to use the WriteXml step but problem is the final result is
<Filters>
<IncludeFilters>
<FilterEntry>
<ModuleMask>Accounting.Service</ModuleMask>
<ClassMask>*</ClassMask>
<FunctionMask>*</FunctionMask>
</FilterEntry>
</IncludeFilters>
so the ModuleMask element is updated but not added again with a new value
Any idea how can I make it to add a new FilterEntry for each element in the loop?
I activated the options "Create element\attribute if it does not exist" and "Update all matching nodes" but it does not help

kinook
10-09-2013, 01:46 PM
You would need to call MSXML directly to insert multiple elements like that.
http://technet.microsoft.com/en-us/magazine/2008.02.heyscriptingguy.aspx

teognost
10-10-2013, 05:18 AM
thanks a lot!