DOM Interoperability
With both the DOM and SimpleXML extensions being tree parsers, this allows for a certain degree of interoperability between the two. This can be handy if you prefer one over the other when refactoring legacy code or if you have use cases for both within a single application. <?php // Converts a SimpleXMLElement to a DOMElement $domElement = dom_import_simplexml($simpleXmlElement); // Converts a DOMNode to a SimpleXMLElement $simpleXmlElement = simplexml_import_dom($domNode); ?> © SimpleXML Extension — Web Scraping >>> Back to TABLE OF CONTENTS <<< | |
Views: 338 | |
Total comments: 0 | |