PDA

View Full Version : Add element into an xml file



norziha
10-27-2011, 12:59 AM
Hi all,

I have an xml file that I needed to update with settings from an installshield dialog. I have 3 configurations that end users will selected. If end user select the configurations then the element and the attributes will created in xml file. If end user not selected no data element existed in xml file. Anybody know how to do this?

I found that installshield have capability to modify the XML file by using the XML file change. But this is in case the elements in an xml file already existed.

If my case is the elements will existed if user select the configuration from the dialog, how to do this?

Please help...

DebbieL
10-27-2011, 08:55 AM
In the XML File Changes view, configure the XML changes that you'll want to occur on some of the systems, and note the name of the component that contains those changes.

On your dialog, you'll probably have something like a radio button group with radio button controls. In that case, you'll need to assign a property, such as MYXMLPROP, to the radio button control. And each radio button can have a different property value identified in the Value setting of the control.

Then you can set a condition on the XML component—something like MYXMLPROP=3, or whatever value is associated with a radio button that should trigger the XML changes. If the condition is false, the XML file changes are not made at run time.

Hopefully that's enough to get you started.