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

PHP
连载3:利用PHP创建由Oracle驱动的SOAP服务
连载4:利用PHP创建由Oracle驱动的SOAP服务
理解Zend 框架 用PHP构建完美的阅读器
利用单元测试在每个层上对PHP代码进行检查
视频演示:Zend Platform功能特性详解
967个函式列表 PHP常用语法索引速查表
心得:PHP对文本数据库的五大基本操作方法
日记整理:Apache+MySql+PHP的快速安装
怎样才能成为PHP高手?学会"懒惰"的去编程
使用m17n实现对各国语言间的代码移植和转换
理解Zend 框架(1):构建完美的阅读器
理解Zend 框架(4): 用Zend_HTTP_Client 获取无提要的内容
ajax的最大缺点是什么?对搜索引擎的支持较弱
windows环境下mysql数据库的主从同步备份步骤
用AJAX实现聊天功能(part 1)
实例:用PHP实现Ftp用户的在线管理
利用PHP和CSS改变网页文字大小
PHP开发大型项目的方法[OOP思想]
直接读取数据库信息的三种方法
PHP5.3中新增的魔术常量__DIR__

PHP中的DOM XML函数


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