Closed tolgaulas closed 8 years ago
Good point.
In my workflow it's almost an edge case, but I understand it can be a reasonable situation.
Given your suggestion I will commit an ->appendXml()
patch to recognize SimpleXMLElement and DOMDocument/DOMNode.
Look for the next commit. ;)
@tolgaulas c21d80a87a185675816a4cb5a3195dee54f468fa improves appendXml()
in a way that it recognize DOMNode
/DOMNodeList
/SimpleXMLElement
/FluidXML
instances.
In the last release (1.9) appendXml()
has been merged with appendChild()
/add()
.
Your code become:
$xml = new SimpleXMLElement($inXML);
$outXML = new FluidXml();
$outXML->add('firstlevel',true)->add($xml);
Closed by 39053c141f6e44373a33c4ac7967554b79ad5396.
Is there a way (better?) then the below?
$xml = new SimpleXMLElement($inXML); $domxml = dom_import_simplexml($xml); $stripedXML = $domxml->ownerDocument->saveXML($domxml->ownerDocument->documentElement); $outXML = new FluidXml(); $outXML->add('firstlevel',true)->appendXml($inXML);