php / ** * Topic: create and parse XML files Using PHP DOM-XML * Source: http://www.php.net/domxml * reason: http://www.zugest.de/und-mitgebaut.de/ PHP / EXTENSION.DOMXML.HTML * Author: urs@circle.ch, 16-1-2001 * * / / Create and resolve XML files // using PHP DOM-XML // Create an XML document object; future processing process will be here On the basis, $ doc = new_xmldoc ("1.0"); // Create a root node and set a property $ root = $ doc-> add_root ("faq"); $ root-> setattr ("Page", "32" ); // child node $ one = $ root-> new_child ("Question", "); // Set the property $ ONE-> Setattr (" Number "," 1 "); // Question is also created The child node and give it $ one-> new_child ("text", "1. WHERE to get libXML-2.0.0?"); $ One-> new_child ("Answer", "You can Download the Latest release of LIBXML EIGER AS A Source Archive or rpm package from http://www.xmlsoft.org. The current version is libXML2-2.2.1. "); $ two $ root-> new_child (" Question, ""); $ Two-> Setattr ("Number", "2"); $ Two-> New_Child ("Text", "2. How to configure php4?"); // Create a node that is not directly assigned $ Twoone = $ TWO -> New_CHILD ("Answer", "" ); // then assign it separately $ twoone-> set_content ("Dir is the libXML Install Directory (if you just use --with-dom it defaults to us --with-dom = / USR / local "); $ three = $ root-> new_child (" Question "," "); $ three-> setattr (" Number "," 7 "); $ three-> new_child (" text "," 7 How to use DOM XML FUNCTION? "); $ Three-> new_child (" Answer "," Read this Document Source for A Simple Example. ");