Tutorial XML

INICIO XML Introducción XML XML Cómo utilizar Árbol XML Sintaxis XML Elementos XML Atributos XML Espacios de nombres XML Pantalla XML Solicitud Http XML Analizador XML DOM XML XPath XML XML XSLT XQuery XML Enlace X XML Validador XML DTD XML Esquema XML Servidor XML Ejemplos XML Cuestionario XML Certificado XML

XML-AJAX

AJAX Introducción AJAX XMLHttp Solicitud AJAX Respuesta AJAX Archivo XML AJAX AJAXPHP Ajax ASP Base de datos AJAX Aplicaciones AJAX Ejemplos de AJAX

DOM XML

DOM Introducción Nodos DOM Acceso DOM Información del nodo DOM Lista de nodos DOM Atravesando DOM Navegación DOM DOM obtener valores Nodos de cambio de DOM Eliminar nodos DOM Nodos de reemplazo de DOM DOM Crear nodos Agregar nodos DOM Nodos de clonación de DOM Ejemplos de DOM

Tutorial XPath

Introducción a XPath Nodos XPath Sintaxis XPath Ejes XPath Operadores XPath Ejemplos de XPath

Tutorial XSLT

XSLT Introducción Idiomas XSL Transformación XSLT XSLT <plantilla> XSLT <valor-de> XSLT <para-cada> XSLT <ordenar> XSLT <si> XSLT <elegir> Aplicar XSLT XSLT en el cliente XSLT en el servidor XSLT Editar XML Ejemplos de XSLT

Tutorial de XQuery

Introducción a XQuery Ejemplo de XQuery XQuery FLWOR XQuery HTML Términos de XQuery Sintaxis XQuery XQuery Agregar Seleccionar XQuery Funciones XQuery

DTD XML

Introducción a DTD Bloques de construcción DTD Elementos DTD Atributos DTD Elementos DTD vs Attr Entidades DTD Ejemplos de DTD

Esquema XSD

XSD Introducción XSD Cómo XSD <esquema> Elementos XSD Atributos XSD Restricciones XSD

Complejo XSD

Elementos XSD XSD vacío Solo elementos XSD Solo texto XSD XSD mixto Indicadores XSD XSD <cualquiera> XSD <cualquieratributo> Sustitución XSD Ejemplo XSD

Datos XSD

Cadena XSD Fecha XSD XSD Numérico Miscelánea XSD Referencia XSD

Servicios web

Servicios XML XML WSDL JABÓN XML XML RDF RSS XML

Referencias

Tipos de nodos DOM Nodo DOM Lista de nodos DOM DOM NamedNodeMap Documento DOM Elemento DOM Atributo DOM Texto DOM DOM CDATA Comentario DOM DOM XMLHttpSolicitud Analizador DOM Elementos XSLT Funciones XSLT/XPath

XML DOM: el objeto del documento


El objeto Document representa todo el documento XML.


El objeto de documento XML

El objeto Documento es la raíz de un árbol de documentos XML y nos brinda el acceso principal a los datos del documento.

Dado que los nodos de elementos, nodos de texto, comentarios, instrucciones de procesamiento, etc. no pueden existir fuera del documento, el objeto Documento también contiene métodos para crear estos objetos. Los objetos Nodo tienen una propiedad OwnerDocument que los asocia con el Documento donde fueron creados.

Propiedades del objeto de documento

Property Description
childNodes Returns a NodeList of child nodes for the document
doctype Returns the Document Type Declaration associated with the document
documentElement Returns the root node of the document
documentURI Sets or returns the location of the document
domConfig Returns the configuration used when normalizeDocument() is invoked
firstChild Returns the first child node of the document
implementation Returns the DOMImplementation object that handles this document
inputEncoding Returns the encoding used for the document (when parsing)
lastChild Returns the last child node of the document
nodeName Returns the name of a node (depending on its type)
nodeType Returns the node type of a node
nodeValue Sets or returns the value of a node (depending on its type)
xmlEncoding Returns the XML encoding of the document
xmlStandalone Sets or returns whether the document is standalone
xmlVersion Sets or returns the XML version of the document

Métodos de objeto de documento

Method Description
adoptNode(sourcenode) Adopts a node from another document to this document, and returns the adopted node
createAttribute(name) Creates an attribute node with the specified name, and returns the new Attr object
createAttributeNS(uri,name) Creates an attribute node with the specified name and namespace, and returns the new Attr object
createCDATASection() Creates a CDATA section node
createComment() Creates a comment node
createDocumentFragment() Creates an empty DocumentFragment object, and returns it
createElement() Creates an element node
createElementNS() Creates an element node with a specified namespace
createEntityReference(name) Creates an EntityReference object, and returns it
createProcessingInstruction(target,data) Creates a ProcessingInstruction object, and returns it
createTextNode() Creates a text node
getElementById(id) Returns the element that has an ID attribute with the given value. If no such element exists, it returns null
getElementsByTagName() Returns a NodeList of all elements with a specified name
getElementsByTagNameNS() Returns a NodeList of all elements with a specified name and namespace
importNode(nodetoimport,deep) Imports a node from another document to this document. This method creates a new copy of the source node. If the deep parameter is set to true, it imports all children of the specified node. If set to false, it imports only the node itself. This method returns the imported node
normalizeDocument()  
renameNode() Renames an element or attribute node


Propiedades del objeto DocumentType

Cada documento tiene un atributo DOCTYPE cuyo valor es nulo o un objeto DocumentType.

El objeto DocumentType proporciona una interfaz para las entidades definidas para un documento XML.

Property Description
name Returns the name of the DTD
publicId Returns the public identifier of the DTD
systemId Returns the system identifier of the external DTD

Métodos de objetos de implementación de documentos

El objeto DOMImplementation realiza operaciones que son independientes de cualquier instancia particular del modelo de objeto de documento.

Method Description
createDocument(nsURI, name, doctype) Creates a new DOM Document object of the specified doctype
createDocumentType(name, pubId, systemId) Creates an empty DocumentType node
getFeature(feature, version) Returns an object which implements the APIs of the specified feature and version, if the is any
hasFeature(feature, version) Checks whether the DOM implementation implements a specific feature and version

Propiedades del objeto ProcessingInstruction

El objeto ProcessingInstruction representa una instrucción de procesamiento.

Una instrucción de procesamiento se usa como una forma de mantener información específica del procesador en el texto del documento XML.

Property Description
data Sets or returns the content of this processing instruction
target Returns the target of this processing instruction