It declares that the document
is XML, which version of XML it is, and what the character encoding is.
We then encounter the opening tag rootNode. XML documents have one root node
that encapsulates the XML document.
APIs and Web Services
[ 278 ]
Within rootNode is another node, subNode. This node contains some data and an
attribute called attr. There is no limit to the depth of an XML document; this is one
of the things that make XML so flexible.
When creating our own XML schemas, we can choose the names of all the tags and
attributes that we are going to implement. Here are some quick pointers that should
help when we come to define and write our own XML documents:
Tag and attribute names are case sensitive.
Tag and attribute names can only contain letters and numbers.
Special characters within data must be encoded.
Tags must be nested correctly.
Attribute values must be encapsulated in double quotes.
Parsing
Joomla! provides us with three different XML parsers: DOMIT (DOM), JSimpleXML
(Simple), and SimplePie (RSS/Atom).
Pages:
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380