I have gone through the Stack Overflow post "Best XML Parser for PHP".
For the same question. It is mentioned that, if I need to manipulate XML files then go for DOM XML. My requirements are:
- I have saved navigation in database. It is an HTML string.
- I want to remove some pages or say
li
tags wrapping pages that user don't want to exist in his/her page. After removing the unwantedli
's, I want to save the whole string back to the database. - The same navigation will be used on another page. But, the HTML will be different. It will be similar, with the
ul
andli
, but I need to add some more divs and spans to it. The navigation will be edited on this page and on each change (e.g. Changing page title, deleting a node/page, moving under another page as child.) a Ajax call will save the changes to another table in database.
Using the new structure, again build the navigation, which will be updated in the first navigation table.
Which will be best option?