Skip to main content

Load an XML document and output it using the PHP DOM parser

This example will create a DOMDocument-Object and load the XML from note.xml into it. It will then use the saveXML() function to put the XML document into a string and output it.

DOM

The DOM parser

The DOM parser allows for the processing of XML documents in PHP. To work with XML documents, an XML parser is required. The DOM XML parser functions are built into the PHP core.

XML PHP DOM Parsing XML Document Object Model Trees

Asynchronous JavaScript and XML (Ajax)

Ajax stands for Asynchronous JavaScript and XML. It is a collection of methods to create asynchronous web applications. The DOM is accessed with JavaScript. HTML and CSS are used to markup style information. XML is used for the interchange of data.

Ajax Javascript XML HTML CSS DOM XSLT

Looping through XML data using the PHP DOM parser

This example will initialize an XML parser. It will then load the XML. It will then loop through all the elements of the note element.

Loops Parsing DOM
Powered by Drupal 7. Made by Cody Bonney.