I'm just learning XML, and I have a file that looks like this
<?xml version="1.0" encoding="UTF-8"?>
<WAT>
<PERSON name="Brandon">
<NAME>Brandon</NAME>
<CHECKED>false</CHECKED>
<DEFAULTS>none</DEFAULTS>
</PERSON>
<PERSON name="Daland">
<NAME>Daland</NAME>
<CHECKED>false</CHECKED>
<DEFAULTS>none</DEFAULTS>
</PERSON>
<PERSON name="Deuce">
<NAME>Deuce</NAME>
<CHECKED>false</CHECKED>
<DEFAULTS>none</DEFAULTS>
</PERSON>
.
.
.
and I want to be able to change the 'CHECKED' element to be true or false (I'm getting value from check boxes on another page) dependent on the person's name (either by attribute, or NAME element). I've tried using all the examples I could find online using both DOM and simpleXML, but I cannot get any working for my needs. So if someone could give a simple code snippet in php that will replace a child node value based on a name it would help alot.
(and please don't just put an answer that says "use replaceChild()" or link to w3schools. I've been searching google for an entire day already to no avail.)
<?xml version="1.0" encoding="UTF-8"?>
<WAT>
<PERSON name="Brandon">
<NAME>Brandon</NAME>
<CHECKED>false</CHECKED>
<DEFAULTS>none</DEFAULTS>
</PERSON>
<PERSON name="Daland">
<NAME>Daland</NAME>
<CHECKED>false</CHECKED>
<DEFAULTS>none</DEFAULTS>
</PERSON>
<PERSON name="Deuce">
<NAME>Deuce</NAME>
<CHECKED>false</CHECKED>
<DEFAULTS>none</DEFAULTS>
</PERSON>
.
.
.
and I want to be able to change the 'CHECKED' element to be true or false (I'm getting value from check boxes on another page) dependent on the person's name (either by attribute, or NAME element). I've tried using all the examples I could find online using both DOM and simpleXML, but I cannot get any working for my needs. So if someone could give a simple code snippet in php that will replace a child node value based on a name it would help alot.
(and please don't just put an answer that says "use replaceChild()" or link to w3schools. I've been searching google for an entire day already to no avail.)