0

I need to edit this XML file and update the values, and save to existing XML file.

<resources>
    <string name="application">generation</string>
    <string name="application2">generation2</string>
    <string-type name="type">single</string-type>
</resources>

I need to update the values, 'generation', 'generation2', 'single' from db. Thanks... hope a quick response. Thanks again.

How to delete child nods??!

user2645118
  • 9
  • 1
  • 7

1 Answers1

0

You should look into DOMDocument which can parse XML or HTML, modify it and export the modified version back to a string.

  • hi André Daniel how to delete a child node – user2645118 Aug 21 '13 at 01:45
  • @user2645118 `node.removeChild($child)`, as described here : http://php.net/manual/en/domnode.removechild.php - there is also a nice example showing how to load an XML file and how to save the modified XML, that's similar to what you need. –  Aug 21 '13 at 01:53
  • That would be $node->removeChild($child) – ChicagoRedSox Aug 21 '13 at 03:28
  • @ChicagoRedSox i'm too used to Python lately... too bad i can't edit my comment. Thanks for correcting me though. –  Aug 21 '13 at 03:35