当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP中的DOM XML函数

PHP
接触 solaris : 安装 apache + php + mysql
图片上传到数据库,该怎么做(包括读取)
初探 PHP5
定制php4的session功能
php写的发送附件的程序(一)
php写的发送附件的程序(二)
Cookie的作用
MySQL数据库备份
基于PHP的聊天室(一)
基于PHP的聊天室(二)
基于PHP的聊天室(三)
管理小型的邮件列表
MySQL用户管理
PHP4与MySQL数据库操作函数详解(一)
PHP4与MySQL数据库操作函数详解(二)
PHP4与MySQL数据库操作函数详解(三)
PHP4与MySQL数据库操作函数详解(四)
PHP4与MySQL数据库操作函数详解(五)
PHP4与MySQL数据库操作函数详解(六)
PHP新手上路(一)

PHP中的DOM XML函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 149 ::
收藏到网摘: n/a

DOMXMLfunctions
ThesefunctionsareonlyavailableifPHPwasconfiguredwith--with-dom=[DIR],usingtheGNOMExmllibrary.Youwillneedatleastlibxml-2.0.0(thebetaversionwillnotwork).ThesefunctionshavebeenaddedinPHP4.

Thismoduledefinesthefollowingconstants:

Table1.XMLconstants

ConstantValueDescription
XML_ELEMENT_NODE1
XML_ATTRIBUTE_NODE2
XML_TEXT_NODE3
XML_CDATA_SECTION_NODE4
XML_ENTITY_REF_NODE5
XML_ENTITY_NODE6
XML_PI_NODE7
XML_COMMENT_NODE8
XML_DOCUMENT_NODE9
XML_DOCUMENT_TYPE_NODE10
XML_DOCUMENT_FRAG_NODE11
XML_NOTATION_NODE12
XML_GLOBAL_NAMESPACE1
XML_LOCAL_NAMESPACE2

Thismoduledefinesanumberofclasses.TheDOMXMLfunctionsreturnaparsedtreeoftheXMLdocumentwitheachnodebeinganobjectbelongingtooneoftheseclasses.

xmldoc
(PHP4>=4.0b4)

xmldoc--CreatesaDOMobjectofanXMLdocument
Description

objectxmldoc(stringstr)


ThefunctionparsestheXMLdocumentinstrandreturnsanobjectofclass"Domdocument",havingtheproperties"doc"(resource),"version"(string)and"type"(long).

xmldocfile
(PHP4>=4.0b4)

xmldocfile--CreatesaDOMobjectfromXMLfile
Description

objectxmldocfile(stringfilename)


ThefunctionparsestheXMLdocumentinthefilenamedfilenameandreturnsanobjectofclass"Domdocument",havingtheproperties"doc"(resource),"version"(string).

xmltree
(PHP4>=4.0b4)

xmltree--CreatesatreeofphpobjectsfromXMLdocument
Description

objectxmltree(stringstr)


ThefunctionparsestheXMLdocumentinstrandreturnsatreePHPobjectsastheparseddocument.