XmlNode Clase
Definición
Representa un único nodo en el documento XML.Represents a single node in the XML document.
public ref class XmlNode abstract : System::Collections::IEnumerable
public ref class XmlNode abstract : ICloneable, System::Collections::IEnumerable, System::Xml::XPath::IXPathNavigable
public abstract class XmlNode : System.Collections.IEnumerable
public abstract class XmlNode : ICloneable, System.Collections.IEnumerable, System.Xml.XPath.IXPathNavigable
type XmlNode = class
interface IEnumerable
type XmlNode = class
interface IEnumerable
interface ICloneable
interface IXPathNavigable
type XmlNode = class
interface ICloneable
interface IEnumerable
interface IXPathNavigable
Public MustInherit Class XmlNode
Implements IEnumerable
Public MustInherit Class XmlNode
Implements ICloneable, IEnumerable, IXPathNavigable
- Herencia
-
XmlNode
- Derivado
- Implementaciones
Comentarios
Esta clase implementa el nivel 1 principal del W3C Document Object Model (DOM) y el nivel 2 del DOM principal.This class implements the W3C Document Object Model (DOM) Level 1 Core and the Core DOM Level 2. El DOM es una representación de árbol en memoria (caché) de un documento XML.The DOM is an in-memory (cache) tree representation of an XML document. XmlNode
es la clase base de la implementación de .NET del DOM.XmlNode
is the base class in the .NET implementation of the DOM. Admite selecciones de XPath y proporciona funciones de edición.It supports XPath selections and provides editing capabilities. La XmlDocument clase extiende XmlNode
y representa un documento XML.The XmlDocument class extends XmlNode
and represents an XML document. Puede usar XmlDocument
para cargar y guardar datos XML.You can use XmlDocument
to load and save XML data. También incluye métodos para la creación de nodos.It also includes methods for node creation. Consulte Document Object Model XML (dom) para obtener más información.See XML Document Object Model (DOM) for more information.
Importante
Las excepciones que se producen como resultado del uso de la XmlNode clase, como la XmlException clase, pueden contener información confidencial que no debe exponerse en escenarios que no son de confianza.Exceptions raised as a result of using the XmlNode class, such as the XmlException class may contain sensitive information that should not be exposed in untrusted scenarios. Las excepciones se deben controlar correctamente para que esta información confidencial no se exponga en escenarios que no son de confianza.Exceptions should be properly handled so that this sensitive information is not exposed in untrusted scenarios.
Propiedades
Attributes |
Obtiene un objeto XmlAttributeCollection que contiene los atributos de este nodo.Gets an XmlAttributeCollection containing the attributes of this node. |
BaseURI |
Obtiene el identificador URI base del nodo actual.Gets the base URI of the current node. |
ChildNodes |
Obtiene todos los nodos secundarios del nodo.Gets all the child nodes of the node. |
FirstChild |
Obtiene el primer nodo secundario del nodo.Gets the first child of the node. |
HasChildNodes |
Obtiene un valor que indica si este nodo tiene nodos secundarios.Gets a value indicating whether this node has any child nodes. |
InnerText |
Obtiene o establece los valores concatenados del nodo y de todos sus nodos secundarios.Gets or sets the concatenated values of the node and all its child nodes. |
InnerXml |
Obtiene o establece el marcado que representa solo los nodos secundarios de este nodo.Gets or sets the markup representing only the child nodes of this node. |
IsReadOnly |
Obtiene un valor que indica si el nodo es de solo lectura.Gets a value indicating whether the node is read-only. |
Item[String, String] |
Obtiene el primer elemento secundario con el LocalName y el NamespaceURI especificados.Gets the first child element with the specified LocalName and NamespaceURI. |
Item[String] |
Obtiene el primer elemento secundario con el Name especificado.Gets the first child element with the specified Name. |
LastChild |
Obtiene el último nodo secundario del nodo.Gets the last child of the node. |
LocalName |
Obtiene el nombre local del nodo, cuando se invalida en una clase derivada.Gets the local name of the node, when overridden in a derived class. |
Name |
Cuando se invalida en una clase derivada, obtiene el nombre completo del nodo.Gets the qualified name of the node, when overridden in a derived class. |
NamespaceURI |
Obtiene el identificador URI de espacio de nombres de este nodo.Gets the namespace URI of this node. |
NextSibling |
Obtiene el nodo inmediatamente siguiente a éste.Gets the node immediately following this node. |
NodeType |
Obtiene el tipo del nodo actual cuando se invalida en una clase derivada.Gets the type of the current node, when overridden in a derived class. |
OuterXml |
Obtiene el marcado que contiene este nodo y todos sus nodos secundarios.Gets the markup containing this node and all its child nodes. |
OwnerDocument |
Obtiene la clase XmlDocument a la que pertenece este nodo.Gets the XmlDocument to which this node belongs. |
ParentNode |
Obtiene el nodo primario de este nodo (para nodos que pueden tener nodos primarios).Gets the parent of this node (for nodes that can have parents). |
Prefix |
Obtiene o establece el prefijo de espacio de nombres de este nodo.Gets or sets the namespace prefix of this node. |
PreviousSibling |
Obtiene el nodo inmediatamente anterior a éste.Gets the node immediately preceding this node. |
PreviousText |
Obtiene el nodo de texto inmediatamente anterior a este.Gets the text node that immediately precedes this node. |
SchemaInfo |
Obtiene el conjunto de información posterior a la validación del esquema que se ha asignado a este nodo como resultado de dicha validación.Gets the post schema validation infoset that has been assigned to this node as a result of schema validation. |
Value |
Obtiene o establece el valor del nodo.Gets or sets the value of the node. |
Métodos
AppendChild(XmlNode) |
Agrega el nodo especificado al final de la lista de nodos secundarios de este nodo.Adds the specified node to the end of the list of child nodes, of this node. |
Clone() |
Crea un duplicado de este nodo.Creates a duplicate of this node. |
CloneNode(Boolean) |
Crea un duplicado del nodo, cuando se invalida en una clase derivada.Creates a duplicate of the node, when overridden in a derived class. |
CreateNavigator() |
Crea un objeto XPathNavigator para desplazarse por este objeto.Creates an XPathNavigator for navigating this object. |
Equals(Object) |
Determina si el objeto especificado es igual que el objeto actual.Determines whether the specified object is equal to the current object. (Heredado de Object) |
GetEnumerator() |
Obtiene un enumerador que recorre en iteración los nodos secundarios del nodo actual.Gets an enumerator that iterates through the child nodes in the current node. |
GetHashCode() |
Sirve como la función hash predeterminada.Serves as the default hash function. (Heredado de Object) |
GetNamespaceOfPrefix(String) |
Busca la declaración xmlns más cercana para el prefijo especificado que está en el ámbito del nodo actual y devuelve el identificador URI de espacio de nombres de la declaración.Looks up the closest xmlns declaration for the given prefix that is in scope for the current node and returns the namespace URI in the declaration. |
GetPrefixOfNamespace(String) |
Busca la declaración xmlns más cercana para el identificador URI de espacio de nombres especificado que está en el ámbito del nodo actual y devuelve el prefijo definido en la declaración.Looks up the closest xmlns declaration for the given namespace URI that is in scope for the current node and returns the prefix defined in that declaration. |
GetType() |
Obtiene el Type de la instancia actual.Gets the Type of the current instance. (Heredado de Object) |
InsertAfter(XmlNode, XmlNode) |
Inserta el nodo especificado inmediatamente detrás del nodo de referencia igualmente especificado.Inserts the specified node immediately after the specified reference node. |
InsertBefore(XmlNode, XmlNode) |
Inserta el nodo especificado inmediatamente antes del nodo de referencia igualmente especificado.Inserts the specified node immediately before the specified reference node. |
MemberwiseClone() |
Crea una copia superficial del Object actual.Creates a shallow copy of the current Object. (Heredado de Object) |
Normalize() |
Hace que todos los nodos XmlText de toda la profundidad del subárbol situado bajo XmlNode aparezcan de forma "normal", de modo que solo el marcado (es decir, las etiquetas, comentarios, instrucciones de procesamiento, secciones CDATA y referencias a entidades) separa los nodos XmlText, es decir, no hay nodos XmlText adyacentes.Puts all XmlText nodes in the full depth of the sub-tree underneath this XmlNode into a "normal" form where only markup (that is, tags, comments, processing instructions, CDATA sections, and entity references) separates XmlText nodes, that is, there are no adjacent XmlText nodes. |
PrependChild(XmlNode) |
Agrega el nodo especificado al principio de la lista de nodos secundarios de este nodo.Adds the specified node to the beginning of the list of child nodes for this node. |
RemoveAll() |
Quita todos los atributos y nodos secundarios del nodo actual.Removes all the child nodes and/or attributes of the current node. |
RemoveChild(XmlNode) |
Quita el nodo secundario especificado.Removes specified child node. |
ReplaceChild(XmlNode, XmlNode) |
Reemplaza el nodo secundario |
SelectNodes(String) |
Selecciona una lista de nodos que coinciden con la expresión XPath.Selects a list of nodes matching the XPath expression. |
SelectNodes(String, XmlNamespaceManager) |
Selecciona una lista de nodos que coinciden con la expresión XPath.Selects a list of nodes matching the XPath expression. Los prefijos encontrados en la expresión XPath se resuelven utilizando el XmlNamespaceManager proporcionado.Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager. |
SelectSingleNode(String) |
Selecciona el primer |
SelectSingleNode(String, XmlNamespaceManager) |
Selecciona el primer |
Supports(String, String) |
Comprueba si la implementación de DOM incluye una característica específica.Tests if the DOM implementation implements a specific feature. |
ToString() |
Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object. (Heredado de Object) |
WriteContentTo(XmlWriter) |
Guarda todos los nodos secundarios del nodo en el XmlWriter especificado, cuando se reemplaza en una clase derivada.Saves all the child nodes of the node to the specified XmlWriter, when overridden in a derived class. |
WriteTo(XmlWriter) |
Guarda el nodo actual en el XmlWriter especificado, cuando se reemplaza en una clase derivada.Saves the current node to the specified XmlWriter, when overridden in a derived class. |
Implementaciones de interfaz explícitas
ICloneable.Clone() |
Para obtener una descripción de este miembro, vea Clone().For a description of this member, see Clone(). |
IEnumerable.GetEnumerator() |
Para obtener una descripción de este miembro, vea GetEnumerator().For a description of this member, see GetEnumerator(). |
Métodos de extensión
Cast<TResult>(IEnumerable) |
Convierte los elementos de IEnumerable en el tipo especificado.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Filtra los elementos de IEnumerable en función de un tipo especificado.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Habilita la paralelización de una consulta.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Convierte una interfaz IEnumerable en IQueryable.Converts an IEnumerable to an IQueryable. |
CreateNavigator(XmlNode) |
Crea un navegador XPath para navegar por el nodo especificado.Creates an XPath navigator for navigating the specified node. |
SelectNodes(XmlNode, String) |
Selecciona una lista de nodos que coinciden con la expresión XPath especificada.Selects a list of nodes matching the specified XPath expression. |
SelectNodes(XmlNode, String, XmlNamespaceManager) |
Selecciona una lista de nodos que coinciden con la expresión XPath especificada.Selects a list of nodes matching the specified XPath expression. Los prefijos encontrados en la expresión XPath se resuelven mediante el administrador de espacios de nombres proporcionado.Any prefixes found in the XPath expression are resolved using the supplied namespace manager. |
SelectSingleNode(XmlNode, String) |
Selecciona el primer nodo que coincide con la expresión XPath.Selects the first node that matches the XPath expression. |
SelectSingleNode(XmlNode, String, XmlNamespaceManager) |
Selecciona el primer nodo que coincide con la expresión XPath.Selects the first node that matches the XPath expression. Los prefijos encontrados en la expresión XPath se resuelven mediante el administrador de espacios de nombres proporcionado.Any prefixes found in the XPath expression are resolved using the supplied namespace manager. |
ToXPathNavigable(XmlNode) |
Crea una IXPathNavigable instancia de que se usa para generar navegadores.Creates an IXPathNavigable instance used for producing navigators. |