Good day,
I am having trouble modifying XML using SimpleXMLElement in PHP.
My XML structure is as below:
<chart caption='NULL' shownames='1' showvalues='0' decimals='2' numberPrefix='$' useRoundEdges='0' legendBorderAlpha='0' bgColor='FFFFFF' canvasBorderColor='A5A5A5' canvasBorderThickness='1' showToolTip='1'>
...
</chart>
How can I modify the attributes() on the root tag using SimpleXMLElement?
Thank you!
EDIT:
Hmm... I found a way but I dont believe its very clean. I added a <root><chart ...>...</chart></root>
tag wraping my XML data. And I finally added str_replace(array("<root>", "</root>"), "", $_RenderedXML->asXML())
to my code. Any idea that is.. "cleaner"?