Jump to content

PHP Programming/XML

From Wikibooks, open books for an open world

XML stands for Extensible Markup Language and is based loosely on HTML. XML is used mainly to store and transfer information from one protocol or language to another. The code for XML is very open, you can create your own tags though they must follow the syntax rules of XML which are very similar to but stricter than HTML. For Example:

 <my_info>
    <my_name>Jeremy</my_name>
    <my_hair_color>Blonde</my_hair_color>
 </my_info>

As you can see, the structure is almost identical to that of HTML, but you are able to define your own tags.

Once the template done, it can be manipulated in PHP by the class DOMDocument(), as mentioned in the chapter PHP Programming/XSL/registerPHPFunctions.