.xsd XML Schema Definition
XML
XML is case sensitive and does not ignore white space.
Root
The root element is the only element in an XML document that does not have a parent.
Element: An element node can contain other elements.1) two branches meet. 2) if it is an empty elements, it would be a leaf node.
Attribute: XPath treats attributes as separate nodes from their element hosts. An attribute is like an element that contains only text.
Text
Comment
Processing instruction
Namespace
Makeup and data
The makeup symbols are delineated by angle brackets(<>)
The standard way for searching through XML documents for particular nodes is called XPath,
Parser: The two basic means to parse XML are: tree and stream.
a tree-based parser
Tree style parsing involves loading the entire XML document into memory. The tree file structure allows for random access to the document's elements and for editing of the XML. Examples of tree-type parsing include the DOM and SimpleXML.
DOM (Document Object Model)
1. The DOM is the W3C DOM specification that you work with in a browser and manipulate with JavaScript. use of the DOM to create an XML string and XML document, formatted for your viewing pleasure.
2. DOM is a W3C standard, which gives the DOM a lot of authority with developers due to its consistency with other programming languages. Because the DOM builds a tree of the entire document, it uses a lot of memory and processor time.
a
SimpleXMLElement
object ß> a DOMElement
objectSimpleXML
1. Provided that the XML document isn't too complicated, too deep, and lacks mixed content, SimpleXML is simpler to use than the DOM, as its name implies.
2. The SimpleXML extension is the tool of choice for parsing an XML document. (easier than DOM)
foreach ($xml->book as $book)
To compare an element or attribute with a string or pass it into a function that requires a string, you must cast it to a string using (string). Otherwise, by default, PHP treats the element as an object
easily add children and attributes.
Stream-based parsers: XMLReader and (Simple API for XML) SAX are stream parses