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

PHP
正确理解PHP程序编译时的错误信息
PHP开发中关于文件操作的疑难问答
PHP.MVC的模板标签系统之标签行为调度
PHP安全配置之实现安全的两个重点
用PHP+java实现自动新闻滚动窗口
PHP编程技巧:看实例学正则表达式
PHP一些常用的正则表达式
PHPUnit袖珍指南之自动测试
PHPUnit袖珍指南之PHPUnit的目的
PHPUnit袖珍指南之安装PHPUnit
PHPUnit袖珍指南之命令行测试工具
PHP中使用crypt()实现用户身份验证
用PHP+MySQL搭建聊天室
如何编译PHP源代码
安全基础:PHP后门的隐藏技巧测试报告
PHP创建和使用session cookie变量
php的curl实现get和post
PHP自动适应范围的页码分页程序
Perl处理日期时间的技巧
php直接调用文本文件内容

PHP中的DOM XML函数


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