Page 1 of 1

I need to modify an XML file

Posted: Wed Jun 25, 2008 9:05 pm
by legend986
I am trying to modify an XML file after it is loaded into the memory. The problem is I do not have access to Javascript and was wondering if there was any other way (like using C) to do this. Everytime I modify, I am changing a fixed set of attributes. Can someone please help me out?

Re: I need to modify an XML file

Posted: Thu Jun 26, 2008 3:03 pm
by Ollie Saunders
Here's the shocker. You can do this in PHP!

Re: I need to modify an XML file

Posted: Thu Jun 26, 2008 3:14 pm
by legend986
Thanks... By any chance do you know of any way of doing the same using C or maybe C++? Basically I forgot to mention it accurately but I am looking to do this either using C or C++...

Re: I need to modify an XML file

Posted: Thu Jun 26, 2008 6:54 pm
by Ollie Saunders
I don't, no. But google does.

Re: I need to modify an XML file

Posted: Thu Jun 26, 2008 7:14 pm
by legend986
I found them but I got a little confused. I want to modify the XML after it has been loaded so that the changes are reflected in the program that has already constructed the DOM tree. Do you think these tools would be useful for that purpose?

Re: I need to modify an XML file

Posted: Thu Jun 26, 2008 9:39 pm
by Ollie Saunders
Yep. I would personally recommend SimpleXML. It's got a few methods such as createElement() etc. although you should check that you're PHP version is new enough to support them.