XXX. DOM FunctionsIntroducciónThe DOM extension is the replacement for the DOM XML extension from PHP 4. The extension still contains many old functions, but they should no longer be used. In particular, functions that are not object-oriented should be avoided. The extension allows you to operate on an XML document with the DOM API. InstalaciónNo se necesita ninguna instalación para usar estas funciones, son parte del núcleo de PHP. Clases predefinidasThe API of the module follows the DOM Level 2 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. Constructor
Métodos
DOMCharacterDataExtends DOMNode. Métodos
DOMCommentExtends DOMCharacterData. Constructor
DOMDocumentExtends DOMNode. Constructor
Métodos
PropiedadesTabla 3.
DOMDocumentTypeExtends DOMNode Each DOMDocument has a doctype attribute whose value is either NULL or a DOMDocumentType object. PropiedadesTabla 4.
DOMElementExtends DOMNode. Constructor
Métodos
DOMEntityExtends DOMNode This interface represents a known entity, either parsed or unparsed, in an XML document. PropiedadesTabla 6.
DOMEntityReferenceExtends DOMNode. Constructor
DOMExceptionDOM operations raise exceptions under particular circumstances, i.e., when an operation is impossible to perform for logical reasons. See also Capítulo 20. DOMImplementationThe DOMImplementation interface provides a number of methods for performing operations that are independent of any particular instance of the document object model. Constructor
Métodos
DOMNodeMétodos
PropiedadesTabla 8.
DOMProcessingInstructionExtends DOMNode. Constructor
DOMTextExtends DOMCharacterData. Constructor
Métodos
DOMXPath
Constructor
Métodos
EjemplosMany examples in this reference require an XML file. We will use book.xml that contains the following:
Constantes predefinidasEstas constantes están definidas por esta extensión y estarán disponibles solamente cuando la extensión ha sido o bien compilada dentro de PHP o grabada dinámicamente en tiempo de ejecución. Tabla 14. XML constants
Tabla 15. DOMException constants
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||