PDA

View Full Version : Editing XML


Seiurus
03-25-2007, 08:25 PM
Hi, does anyone knows the right way to manipulate XML in Setup Factory? I am trying to edit the config file at my desktop but the XML code seens not to be working.

I am placing the XML code in a Search Screen that I created. It searches through all the drives for my installer files to replace a config.xml file value.

My code is:

XML.Load("C:\Documents and Settings\uepub\Desktop\config.xml");
XML.SetValue("config/section:8/key:4", "xxx");
XML.Save("C:\Documents and Settings\uepub\Desktop\config.xml");

I need to change the value for "ProfileSelection" under the 8th "Section" and 4th "Key" from 0 to 1.

Pls look through the following XML file below:
http://www.longman.com.sg/downloads/config.xml

Thanks and your help is very much appreciated!

Adam
03-26-2007, 12:40 PM
In Setup Factory you need to use \\ for paths in script.

Your code should look like this:


XML.Load("C:\\Documents and Settings\\uepub\\Desktop\\config.xml");
XML.SetValue("config/section:8/key:4", "xxx");
XML.Save("C:\\Documents and Settings\\uepub\\Desktop\\config.xml");


Not sure if this solves the problem or not but it will at least run the xml actions properly.

Adam Kapilik

Seiurus
03-26-2007, 09:40 PM
Thank you Adam! I got the script to work. Now I am able to edit the XML. Thank you very much!