Create and resolve XML files using PHP DOM-XML

xiaoxiao2021-04-10  528

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. ");

转载请注明原文地址:https://www.9cbs.com/read-133408.html

New Post(0)