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

PHP
AJAX在PHP中的简单使用
vim下高亮显示php代码
用 PHP 使 Web 数据分析进入更高境界
用Apache与MySQL整合实现基本身份认证
通用PHP动态生成静态HTML网页的代码
自己轻松修复Discuz!数据库技巧
PHP在Web开发领域的优势在哪?
php4和php5单态模式(Singleton Pattern)写法
使用Xdebug优化你的php程序
PHP学习入门的一些基础知识
关于正则表达式学习
浅谈PHP开发团队的管理之道
传奇的诞生,PHP三位创始人简介
利用PHP制作简单的内容采集器
PHP精确到每一秒钟的在线人数显示代码
一些PHP学习过程中的心得和经验
WINDOWS服务器安装多套PHP的另类解决方案
让你的PHP引擎全速运转的三个简单绝招
大型系统上PHP令人不爽的九大原因
php的计数器程序

PHP中的DOM XML函数


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