Updating an XML node in PHP

chasmelendez76

New Member
I am having trouble updating nodes in an xml file. My xml files is like this: \[code\] <container id="header"> <widgetname="header" cache='true' cachetime='7200' ><parameter name="image" value="http://stackoverflow.com/questions/12684753/gnome"></parameter></widget> </container> <container id="nav_wrapper"> <container id="main_menu_container"> <widget name="menu"> <parameter name="menuid" value="http://stackoverflow.com/questions/12684753/9"></parameter> </widget> </container> <container id="search_wrapper"> <widget name="search" cache='true' cachetime='7200' ></widget> </container> </container> <container class="subpage_wrapper"> <container id="leftcol"> <container class="subnav"> <widget name="menu"> <parameter name="menuid" value="http://stackoverflow.com/questions/12684753/5"></parameter> </widget> </container> </container> <container id="rightcol"> <page name="articlelist"></widget> </container> </container></container></layout>\[/code\]The layout for the whole page will be rendered according to this xml, which is working properly. The trouble starts when the admin have to update the parameters to the widgets. For that I have provided a preview layout and the admin can select the parameters to the widgets. For e.g. When the admin click config for the \[code\]container>topbar>top_nav>menu\[/code\] widget he will be provided with all the available options. But I haven't found any solution for saving the newly selected value to that node.
Does anyone have any idea how to do that?[Edit] The main issue is that the child element can be infinite. Also there may be more than one child for the same path container>container>widget will repeat may times in the xml
 
Back
Top