I have an installer that needs to modify an existing XML document. The document currently has a node structure that looks like this:
<TypeMapping><Type>
<Name>name a</Name>
<Namespace>namespace a</Namespace>
<CLSID>clsid a</CLSID>
</Type>
<Type>
<Name>name b</Name>
<Namespace>namespace b</Namespace>
<CLSID>clsid b</CLSID>
</Type>
</TypeMapping>
My installer needs to add a couple of type elements with their own Name, Namespace, and CLSID child elements. I've tried to use wizou's XML plugin, but was not seeing my new entry added to the XML file. Here's what I tested:
Section "Test"
nsisXML::create
nsisXML::load "sample.dat" ;file in the same directory as installer
nsisXML::select "main"
nsisXML::createElement "Type"
nsisXML::appendChild
StrCpy $1 $2
nsisXML::createElement "Name"
nsisXML::setText "MultiDirectionalHillshadeFunction"
nsisXML::appendChild
nsisXML::createElement "Namespace"
nsisXML::setText "url"
nsisXML::appendChild
nsisXML::createElement "CLSID"
nsisXML::setText "{clsid number}"
nsisXML::appendChild
nsisXML::save "Sample.xml"
SectionEnd
Would anyone care to suggest an alternate method, or maybe fill me in on what I'm doing wrong with the plugin from wizou? A lot of the threads I've read are a bit dated, so I wasn't sure what the best practice would be like when it comes to this sort of task.