I'm trying to read and write to an XML file that is always different.
What I want to do is define CSS properties that can be changed for each class/id in my css (which is done by php).
So an element could look like this:
<element id="header">
<position>left</position>
<background>#fff</background>
<color>#000</color>
<border>2px dotted #GGG</border>
</element>
But the inner nodes could change (any css property).
I want to read this and then make a form in which I can edit the properties (managed to do this).
Now I need to save the XML. I can't submit the complete form at once, because of PHP (Can't submit forms you don't know the form-element names). I'm trying to do it with Ajax and save each node when edited in the form. (onChange)
So I know the "id" tag of the element and the node name. But I couldn't find a way to directly access the node and edit it with DOMDocument or SimpleXML.
I've been told to try XPath, but I couldn't use XPath to edit.
How could I attempt to do this?