writing to XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ards
Forum Newbie
Posts: 3
Joined: Wed Apr 26, 2006 9:01 am

writing to XML

Post by ards »

hi, this is my first post in these forums but i have been a reader for some time.
i have a question about writing data back into an XML file and am after some quick clarification. (all in php v4.4)

i am using xml_parser to read in data from a simple xml file.
i can compare tags to extract data from the right children

so for something simple like this:

Code: Select all

<ExtractedParam>
   <Systolic>123</Systolic>
   <Diastolic>88</Diastolic>
   <HeartRate>46</HeartRate>
</ExtractedParam>
i can extract the value for systolic and use that somewhere. I am having issues with saving an update.

-->>how do i go about writing a new vale to the systolic child for eg.<<--

when i use fread() i get all the data, but none of the node names. (ie "123,88,46")

how do i find the right node and write the new value to the xml file... anything will help..
thanks in advance!
Post Reply