Using the following method, you can see the use of minixml, compared with activelink-php-xml-package-0.4.0, more in line with the use of habits, but also more simple.
$xmlDoc = new Minixmldoc ();
$xmlRoot =& $xmlDoc->getroot ();
$childElement =& $xmlRoot->createchild (\ ' achild\ ');
$childElement->attribute (\ ' name\ ', \ ' annie\ ');
$childElement->text (\ ' This element has attributes and children, such as This\ ');
$image =& $childElement->createchild (\ ' image\ ');
$image->attribute (\ ' location\ ', \ ' http://psychogenic.com/image.png\ ');
$childElement->text (\ ' image and Little\ ');
$orphan =& $xmlDoc->createelement (\ ' song\ ');
$orphan->text (\ ' Tomorrow, tomorrow\ ');
$childElement->appendchild ($orphan);
Print $xmlDoc->tostring ();
Add a child element, there are two ways, the first is directly the node Createchild, the second is first XmlDoc first createelement, then, the node in AppendChild.
The final print results are:
This element have attributes and children, such as this
Image and Little
tomorrow, Tomorrow
It can be clearly seen that the use of minixml is very simple, especially for the simple preservation of the data of the XML file, more so, the details can be seen in the example provided by Minixml. It is unknown here.
=========================================================================
Analytical
The Minixml file structure is:
minixml.inc.php
------Classes
-----------doc.inc.php element.inc.php node.inc.php treecomp.inc.php
Detailed explanation of the API, on the official website is introduced: http://minixml.psychogenic.com/api.html.
The above describes the HP mini110 PHP minixml details, including the HP mini110 aspects of the content, I hope to be interested in PHP tutorial friends helpful.