{{distinguish, text=the SimpleXML PHP extension
Simple XML is a variation of
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
containing only elements. All attributes are converted into elements. Not having attributes or other xml elements such as the XML declaration / DTDs allows the use of simple and fast parsers. This format is also compatible with mainstream XML parsers.
Structure
For example:
gardeningWateringcooking
would represent:
Validation
Simple XML uses a simple
XPath
XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) in 1999, and can be used to compute values (e.g., strings, numbers, or ...
list for validation. The XML snippet above for example, would be represented by:
/Agenda/type, (Activity/type, (*/time))
or a bit more human readable as:
/Agenda/type
/Agenda/Activity/type
/Agenda/Activity/*/time
This allows the XML to be processed as a stream (without creating an object model in memory) with fast validation.