2. XML parsing
• Very well defined, well known standards
• Excellent support ...
• ... in most other languages
• Long-standing PHP weakness
(up to version 4)
7. Document Object Model
• Full object representation of an XML
document
• Supports writing documents
• Same system used by browsers, javascript,
etc (i.e. “known quantity”)
8. Other key concepts
• Namespaces: Allow extending existing XML
documents
• XPath: selector syntax for addressing parts
of a document
• XSLT: “template” language for transforming
XML documents into other formats
9. DOM in PHP
• http://php.net/domxml
• Traditionally required external libraries and
additional PHP compile flags
• Has been removed from PHP core in PHP5
(available as a PECL module)
• not really an option for Drupal core
10. SAX in PHP
• Available in PHP 4 & PHP 5 ( --with-xml )
• Closest “built-in” support
• (hence what we use in Drupal)
• http://php.net/xml