I need to modify an XML file

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
legend986
Forum Contributor
Posts: 258
Joined: Sun Jul 15, 2007 2:45 pm

I need to modify an XML file

Post 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?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: I need to modify an XML file

Post by Ollie Saunders »

Here's the shocker. You can do this in PHP!
User avatar
legend986
Forum Contributor
Posts: 258
Joined: Sun Jul 15, 2007 2:45 pm

Re: I need to modify an XML file

Post 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++...
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: I need to modify an XML file

Post by Ollie Saunders »

I don't, no. But google does.
User avatar
legend986
Forum Contributor
Posts: 258
Joined: Sun Jul 15, 2007 2:45 pm

Re: I need to modify an XML file

Post 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?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: I need to modify an XML file

Post 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.
Post Reply