Re: RemoveChild Problem
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2001-12-11 22:49:34
|
If you have: <DATA> <MON10> <geburtstag> <datum>1007124443</datum> <name>hgvghv</name> <tag>9</tag> </geburtstag> <geburtstag> <datum>1007124467</datum> <name>adsd</name> <tag>9</tag> </geburtstag> </MON10> </DATA> And you search for: $path = $xpath_del->evaluate("/*/*/geburtstag"); Then you get: /DATA[1]/MON10[1]/geburtstag[1] /DATA[1]/MON10[1]/geburtstag[2] Now if you delete /DATA[1]/MON10[1]/geburtstag[1], then your XML becomes: <DATA> <MON10> <geburtstag> <datum>1007124467</datum> <name>adsd</name> <tag>9</tag> </geburtstag> </MON10> </DATA> So when you now try to delete /DATA[1]/MON10[1]/geburtstag[2] it doesn't exist does it? As there is only one geburtstag[] child node of MON10. Which is why you get: > Warning: Undefined index: geburtstag[2] in > E:\imeso\web\portal\data\xpath.class.php on line 1098 There are other errors in your sample output, but as your sample output does not completely match the XML that you have mailed, (ie what is MON11??) I can't really help you with the others. Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |