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

PHP
PHP 如何向 MySQL 发送数据
一个取得文件扩展名的函数
php生成EXCEL的东东
用PHP和ACCESS写聊天室(十)
用PHP和ACCESS写聊天室(七)
用PHP和ACCESS写聊天室(八)
用PHP和ACCESS写聊天室(九)
投票管理程序
为查询结果建立向后/向前按钮
用ODBC的分页显示
一个简洁的多级别论坛
PHP中对数据库操作的封装
如何开发一个虚拟域名系统
用PHP+MySql编写聊天室
不用数据库的多用户文件自由上传投票系统(3)
用PHP和ACCESS写聊天室(一)
用PHP和ACCESS写聊天室(二)
对javascript和select部件的结合运用
用PHP和ACCESS写聊天室(三)
很实用的一个完整email发送程序

PHP中的DOM XML函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 237 ::
收藏到网摘: 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.