XXX. DOM Functions简介The DOM extension allows you to operate on XML documents through the DOM API with PHP 5. For PHP 4, use DOM XML. 安装本扩展模块作为 PHP 内核的一部分,无需安装即可使用。 预定义类The API of the module follows the DOM Level 3 standard as closely as possible. Consequently, the API is fully object-oriented. It is a good idea to have the DOM standard available when using this module. This module defines a number of classes, which are explained in the following tables. Classes with an equivalent in the DOM standard are named DOMxxx. DOMAttrExtends DOMNode. The DOMAttr interface represents an attribute in an DOMElement object. 构造函数
方法
DOMCharacterDataExtends DOMNode. 方法
DOMCommentExtends DOMCharacterData. 构造函数
DOMDocumentExtends DOMNode. 构造函数
方法
属性表 3.
DOMDocumentFragmentExtends DOMNode. 方法
DOMDocumentTypeExtends DOMNode Each DOMDocument has a doctype attribute whose value is either NULL or a DOMDocumentType object. 属性表 4.
DOMElementExtends DOMNode. 构造函数
方法
DOMEntityExtends DOMNode This interface represents a known entity, either parsed or unparsed, in an XML document. 属性表 6.
DOMEntityReferenceExtends DOMNode. 构造函数
DOMExceptionDOM operations raise exceptions under particular circumstances, i.e., when an operation is impossible to perform for logical reasons. See also u? 20 章. DOMImplementationThe DOMImplementation interface provides a number of methods for performing operations that are independent of any particular instance of the document object model. 构造函数
方法
DOMNamedNodeMap方法
DOMNode方法
属性表 8.
DOMProcessingInstructionExtends DOMNode. 构造函数
DOMTextExtends DOMCharacterData. 构造函数
方法
DOMXPath
构造函数
方法
范例Many examples in this reference require an XML file. We will use book.xml that contains the following:
预定义常量以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。 表 14. XML constants
表 15. DOMException constants
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||