PHP - XML Introduction
What is XML?
XML is a mark-up language to share the data across the web, XML is for both human read-able and machine read-able. Example of share-able xmls are RSS Feeds. XML parsers are useful to read and update the data by using web browsers.
Types of XML
- Tree based
- Event based
XML Parse Extensions
XML parse Extensions are works based on libxml. The following xml parsers are available in the php core.
- Simple XML parser
- DO XML parser
- XML parser
- XML Reader
Simple XML parser
The Simple XML parser also called as tree based XML parser and it will parse the simple XML file. Simple XML parse will call simplexml_load_file() method to get access to the xml from specific path.
DOM Parser also called as a complex node parser, Which is used to parse highly complex XML file. It is used as interface to modify the XML file. DOM parser has encoded with UTF-8 character encoding.
XML parsing is based on SAX parse. It is more faster the all above parsers. It will create the XML file and parse the XML. XML parser has encoded by ISO-8859-1, US-ASCII and UTF-8 character encoding.
XML Reader parse also called as Pull XML parse. It is used to read the XML file in a faster way. It works with high complex XML document with XML Validation.