查看完整版本: PHP中的DOM XML函数

lily 2007-8-1 22:39

PHP中的DOM XML函数

             <p>非常不好意思,没时间翻译,只好直接贴出来了<BR><BR>DOM <a href="http://www.phpchina.com/javascript:;" onClick="javascript:tagshow(event, 'XML');" target="_self"><u><strong>XML</strong></u></a> functions<BR>These functions are only available if <a href="http://www.phpchina.com/javascript:;" onClick="javascript:tagshow(event, 'PHP');" target="_self"><u><strong>PHP</strong></u></a> was configured with --with-dom=[DIR], using the GNOME xml library. You will need at least libxml-2.0.0 (the beta version will not work). These functions have been added in PHP4. <BR><BR>This module defines the following constants: <BR><BR>Table 1. XML constants<BR><BR>Constant Value Description <BR>XML_ELEMENT_NODE 1&nbsp;&nbsp;&nbsp;<BR>XML_ATTRIBUTE_NODE 2&nbsp;&nbsp;&nbsp;<BR>XML_TEXT_NODE 3&nbsp;&nbsp;&nbsp;<BR>XML_CDATA_SECTION_NODE 4&nbsp;&nbsp;&nbsp;<BR>XML_ENTITY_REF_NODE 5&nbsp;&nbsp;&nbsp;<BR>XML_ENTITY_NODE 6&nbsp;&nbsp;&nbsp;<BR>XML_PI_NODE 7&nbsp;&nbsp;&nbsp;<BR>XML_COMMENT_NODE 8&nbsp;&nbsp;&nbsp;<BR>XML_DOCUMENT_NODE 9&nbsp;&nbsp;&nbsp;<BR>XML_DOCUMENT_TYPE_NODE 10&nbsp;&nbsp;&nbsp;<BR>XML_DOCUMENT_FRAG_NODE 11&nbsp;&nbsp;&nbsp;<BR>XML_NOTATION_NODE 12&nbsp;&nbsp;&nbsp;<BR>XML_GLOBAL_NAMESPACE 1&nbsp;&nbsp;&nbsp;<BR>XML_LOCAL_NAMESPACE 2&nbsp;&nbsp;&nbsp;<BR><BR>This module defines a number of classes. The DOM XML functions return a parsed tree of the XML document with each node being an object belonging to one of these classes. <BR><BR>xmldoc<BR>(PHP4 &gt;= 4.0b4)<BR><BR>xmldoc -- Creates a DOM object of an XML document<BR>Description<BR><BR>object xmldoc (string str)<BR><BR><BR>The function parses the XML document in str and returns an object of class "Dom document", having the properties "doc" (resource), "version" (string) and "type" (long). <BR><BR>xmldocfile<BR>(PHP4 &gt;= 4.0b4)<BR><BR>xmldocfile -- Creates a DOM object from XML file<BR>Description<BR><BR>object xmldocfile (string filename)<BR><BR><BR>The function parses the XML document in the file named filename and returns an object of class "Dom document", having the properties "doc" (resource), "version" (string). <BR><BR>xmltree<BR>(PHP4 &gt;= 4.0b4)<BR><BR>xmltree --&nbsp;&nbsp;Creates a tree of php objects from XML document <BR>Description<BR><BR>object xmltree (string str)<BR><BR><BR>The function parses the XML document in str and returns a tree PHP objects as the parsed document. <BR><BR></p>     <center><input type="image" onclick=copyToClipBoard() src="http://www.phpchina.com/images/phpcn_book_bu_tj.gif" border="0"></center>
页: [1]
查看完整版本: PHP中的DOM XML函数
PageRank