mscorlib(4.0.0.0) API with additions
|
Represents a single node in the XML document. More...
Public Member Functions | |
virtual XPathNavigator | CreateNavigator () |
Creates an T:System.Xml.XPath.XPathNavigator for navigating this object. More... | |
XmlNode | SelectSingleNode (string xpath) |
Selects the first XmlNode that matches the XPath expression. More... | |
XmlNode | SelectSingleNode (string xpath, XmlNamespaceManager nsmgr) |
Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied T:System.Xml.XmlNamespaceManager. More... | |
XmlNodeList | SelectNodes (string xpath) |
Selects a list of nodes matching the XPath expression. More... | |
XmlNodeList | SelectNodes (string xpath, XmlNamespaceManager nsmgr) |
Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied T:System.Xml.XmlNamespaceManager. More... | |
virtual XmlNode | InsertBefore (XmlNode newChild, XmlNode refChild) |
Inserts the specified node immediately before the specified reference node. More... | |
virtual XmlNode | InsertAfter (XmlNode newChild, XmlNode refChild) |
Inserts the specified node immediately after the specified reference node. More... | |
virtual XmlNode | ReplaceChild (XmlNode newChild, XmlNode oldChild) |
Replaces the child node oldChild with newChild node. More... | |
virtual XmlNode | RemoveChild (XmlNode oldChild) |
Removes specified child node. More... | |
virtual XmlNode | PrependChild (XmlNode newChild) |
Adds the specified node to the beginning of the list of child nodes for this node. More... | |
virtual XmlNode | AppendChild (XmlNode newChild) |
Adds the specified node to the end of the list of child nodes, of this node. More... | |
abstract XmlNode | CloneNode (bool deep) |
Creates a duplicate of the node, when overridden in a derived class. More... | |
virtual void | Normalize () |
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. More... | |
virtual bool | Supports (string feature, string version) |
Tests if the DOM implementation implements a specific feature. More... | |
virtual XmlNode | Clone () |
Creates a duplicate of this node. More... | |
IEnumerator | GetEnumerator () |
Get an enumerator that iterates through the child nodes in the current node. More... | |
abstract void | WriteTo (XmlWriter w) |
Saves the current node to the specified T:System.Xml.XmlWriter, when overridden in a derived class. More... | |
abstract void | WriteContentTo (XmlWriter w) |
Saves all the child nodes of the node to the specified T:System.Xml.XmlWriter, when overridden in a derived class. More... | |
virtual void | RemoveAll () |
Removes all the child nodes and/or attributes of the current node. More... | |
virtual string | GetNamespaceOfPrefix (string prefix) |
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. More... | |
virtual string | GetPrefixOfNamespace (string namespaceURI) |
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. More... | |
Public Attributes | |
virtual XmlNodeList | ChildNodes => new XmlChildNodes(this) |
Gets all the child nodes of the node. More... | |
virtual XmlNode | PreviousSibling => null |
Gets the node immediately preceding this node. More... | |
virtual XmlNode | NextSibling => null |
Gets the node immediately following this node. More... | |
virtual XmlAttributeCollection | Attributes => null |
Gets an T:System.Xml.XmlAttributeCollection containing the attributes of this node. More... | |
virtual XmlNode | FirstChild => LastNode?.next |
Gets the first child of the node. More... | |
virtual XmlNode | LastChild => LastNode |
Gets the last child of the node. More... | |
virtual bool | HasChildNodes => LastNode != null |
Gets a value indicating whether this node has any child nodes. More... | |
virtual string | NamespaceURI => string.Empty |
Gets the namespace URI of this node. More... | |
virtual IXmlSchemaInfo | SchemaInfo => XmlDocument.NotKnownSchemaInfo |
Gets the post schema validation infoset that has been assigned to this node as a result of schema validation. More... | |
virtual XmlNode | PreviousText => null |
Gets the text node that immediately precedes this node. More... | |
Properties | |
abstract string | Name [get] |
Gets the qualified name of the node, when overridden in a derived class. More... | |
virtual string | Value [get, set] |
Gets or sets the value of the node. More... | |
abstract XmlNodeType | NodeType [get] |
Gets the type of the current node, when overridden in a derived class. More... | |
virtual XmlNode | ParentNode [get] |
Gets the parent of this node (for nodes that can have parents). More... | |
virtual XmlDocument | OwnerDocument [get] |
Gets the T:System.Xml.XmlDocument to which this node belongs. More... | |
virtual string | Prefix [get, set] |
Gets or sets the namespace prefix of this node. More... | |
abstract string | LocalName [get] |
Gets the local name of the node, when overridden in a derived class. More... | |
virtual bool | IsReadOnly [get] |
Gets a value indicating whether the node is read-only. More... | |
virtual string | InnerText [get, set] |
Gets or sets the concatenated values of the node and all its child nodes. More... | |
virtual string | OuterXml [get] |
Gets the markup containing this node and all its child nodes. More... | |
virtual string | InnerXml [get, set] |
Gets or sets the markup representing only the child nodes of this node. More... | |
virtual string | BaseURI [get] |
Gets the base URI of the current node. More... | |
virtual XmlElement | this[string name] [get] |
Gets the first child element with the specified P:System.Xml.XmlNode.Name. More... | |
virtual XmlElement | this[string localname, string ns] [get] |
Gets the first child element with the specified P:System.Xml.XmlNode.LocalName and P:System.Xml.XmlNode.NamespaceURI. More... | |
Represents a single node in the XML document.
Definition at line 13 of file XmlNode.cs.
Adds the specified node to the end of the list of child nodes, of this node.
newChild | The node to add. All the contents of the node to be added are moved into the specified location. |
T:System.InvalidOperationException | This node is of a type that does not allow child nodes of the type of the newChild node.The newChild is an ancestor of this node. |
T:System.ArgumentException | The newChild was created from a different document than the one that created this node.This node is read-only. |
Reimplemented in System.Xml.XmlAttribute.
Definition at line 833 of file XmlNode.cs.
|
virtual |
Creates a duplicate of this node.
Implements System.ICloneable.
Definition at line 1090 of file XmlNode.cs.
|
pure virtual |
Creates a duplicate of the node, when overridden in a derived class.
deep | true to recursively clone the subtree under the specified node; false to clone only the node itself. |
T:System.InvalidOperationException | Calling this method on a node type that cannot be cloned. |
Implemented in System.Xml.XmlDocument, System.Xml.XmlElement, System.Xml.XmlAttribute, System.Xml.XmlDeclaration, System.Xml.XmlDocumentType, System.Xml.XmlEntity, System.Xml.XmlProcessingInstruction, System.Xml.XmlSignificantWhitespace, System.Xml.XmlWhitespace, System.Xml.XmlText, System.Xml.XmlEntityReference, System.Xml.XmlCDataSection, System.Xml.XmlDocumentFragment, System.Xml.XmlNotation, and System.Xml.XmlComment.
|
virtual |
Creates an T:System.Xml.XPath.XPathNavigator for navigating this object.
XPathNavigator
object used to navigate the node. The XPathNavigator
is positioned on the node from which the method was called. It is not positioned on the root of the document.Implements System.Xml.XPath.IXPathNavigable.
Reimplemented in System.Xml.XmlDocument.
Definition at line 416 of file XmlNode.cs.
IEnumerator System.Xml.XmlNode.GetEnumerator | ( | ) |
Get an enumerator that iterates through the child nodes in the current node.
Implements System.Collections.IEnumerable.
Definition at line 1111 of file XmlNode.cs.
|
virtual |
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.
prefix | The prefix whose namespace URI you want to find. |
Definition at line 1158 of file XmlNode.cs.
|
virtual |
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.
namespaceURI | The namespace URI whose prefix you want to find. |
Definition at line 1243 of file XmlNode.cs.
Inserts the specified node immediately after the specified reference node.
newChild | The XmlNode to insert. |
refChild | The XmlNode that is the reference node. The newNode is placed after the refNode . |
T:System.InvalidOperationException | This node is of a type that does not allow child nodes of the type of the newChild node.The newChild is an ancestor of this node. |
T:System.ArgumentException | The newChild was created from a different document than the one that created this node.The refChild is not a child of this node.This node is read-only. |
Reimplemented in System.Xml.XmlAttribute.
Definition at line 623 of file XmlNode.cs.
Inserts the specified node immediately before the specified reference node.
newChild | The XmlNode to insert. |
refChild | The XmlNode that is the reference node. The newChild is placed before this node. |
T:System.InvalidOperationException | The current node is of a type that does not allow child nodes of the type of the newChild node.The newChild is an ancestor of this node. |
T:System.ArgumentException | The newChild was created from a different document than the one that created this node.The refChild is not a child of this node.This node is read-only. |
Reimplemented in System.Xml.XmlAttribute.
Definition at line 514 of file XmlNode.cs.
|
virtual |
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.
Definition at line 976 of file XmlNode.cs.
Adds the specified node to the beginning of the list of child nodes for this node.
newChild | The node to add. All the contents of the node to be added are moved into the specified location. |
T:System.InvalidOperationException | This node is of a type that does not allow child nodes of the type of the newChild node.The newChild is an ancestor of this node. |
T:System.ArgumentException | The newChild was created from a different document than the one that created this node.This node is read-only. |
Reimplemented in System.Xml.XmlAttribute.
Definition at line 823 of file XmlNode.cs.
|
virtual |
Removes all the child nodes and/or attributes of the current node.
Reimplemented in System.Xml.XmlElement.
Definition at line 1143 of file XmlNode.cs.
Removes specified child node.
oldChild | The node being removed. |
T:System.ArgumentException | The oldChild is not a child of this node. Or this node is read-only. |
Reimplemented in System.Xml.XmlAttribute.
Definition at line 746 of file XmlNode.cs.
Replaces the child node oldChild with newChild node.
newChild | The new node to put in the child list. |
oldChild | The node being replaced in the list. |
T:System.InvalidOperationException | This node is of a type that does not allow child nodes of the type of the newChild node.The newChild is an ancestor of this node. |
T:System.ArgumentException | The newChild was created from a different document than the one that created this node.This node is read-only.The oldChild is not a child of this node. |
Reimplemented in System.Xml.XmlAttribute.
Definition at line 734 of file XmlNode.cs.
XmlNodeList System.Xml.XmlNode.SelectNodes | ( | string | xpath | ) |
Selects a list of nodes matching the XPath expression.
xpath | The XPath expression. |
T:System.Xml.XPath.XPathException | The XPath expression contains a prefix. See XPath Examples. |
Definition at line 457 of file XmlNode.cs.
XmlNodeList System.Xml.XmlNode.SelectNodes | ( | string | xpath, |
XmlNamespaceManager | nsmgr | ||
) |
Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied T:System.Xml.XmlNamespaceManager.
xpath | The XPath expression. See XPath Examples. |
nsmgr | An T:System.Xml.XmlNamespaceManager to use for resolving namespaces for prefixes in the XPath expression. |
T:System.Xml.XPath.XPathException | The XPath expression contains a prefix which is not defined in the XmlNamespaceManager . |
Definition at line 472 of file XmlNode.cs.
XmlNode System.Xml.XmlNode.SelectSingleNode | ( | string | xpath | ) |
Selects the first XmlNode
that matches the XPath expression.
T:System.Xml.XPath.XPathException | The XPath expression contains a prefix. |
Definition at line 431 of file XmlNode.cs.
XmlNode System.Xml.XmlNode.SelectSingleNode | ( | string | xpath, |
XmlNamespaceManager | nsmgr | ||
) |
Selects the first XmlNode
that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied T:System.Xml.XmlNamespaceManager.
xpath | The XPath expression. See XPath Examples. |
nsmgr | An T:System.Xml.XmlNamespaceManager to use for resolving namespaces for prefixes in the XPath expression. |
T:System.Xml.XPath.XPathException | The XPath expression contains a prefix which is not defined in the XmlNamespaceManager . |
Definition at line 441 of file XmlNode.cs.
|
virtual |
Tests if the DOM implementation implements a specific feature.
feature | The package name of the feature to test. This name is not case-sensitive. |
version | The version number of the package name to test. If the version is not specified (null), supporting any version of the feature causes the method to return true. |
true
if the feature is implemented in the specified version; otherwise, false
. The following table describes the combinations that return true
.Feature Version XML 1.0 XML 2.0 Definition at line 1059 of file XmlNode.cs.
|
pure virtual |
Saves all the child nodes of the node to the specified T:System.Xml.XmlWriter, when overridden in a derived class.
w | The XmlWriter to which you want to save. |
Implemented in System.Xml.XmlDocument, System.Xml.XmlElement, System.Xml.XmlAttribute, System.Xml.XmlDeclaration, System.Xml.XmlDocumentFragment, System.Xml.XmlEntity, System.Xml.XmlDocumentType, System.Xml.XmlEntityReference, System.Xml.XmlText, System.Xml.XmlProcessingInstruction, System.Xml.XmlSignificantWhitespace, System.Xml.XmlWhitespace, System.Xml.XmlCDataSection, System.Xml.XmlNotation, and System.Xml.XmlComment.
|
pure virtual |
Saves the current node to the specified T:System.Xml.XmlWriter, when overridden in a derived class.
w | The XmlWriter to which you want to save. |
Implemented in System.Xml.XmlDocument, System.Xml.XmlElement, System.Xml.XmlAttribute, System.Xml.XmlDeclaration, System.Xml.XmlDocumentFragment, System.Xml.XmlEntity, System.Xml.XmlDocumentType, System.Xml.XmlEntityReference, System.Xml.XmlText, System.Xml.XmlProcessingInstruction, System.Xml.XmlSignificantWhitespace, System.Xml.XmlWhitespace, System.Xml.XmlCDataSection, System.Xml.XmlNotation, and System.Xml.XmlComment.
virtual XmlAttributeCollection System.Xml.XmlNode.Attributes => null |
Gets an T:System.Xml.XmlAttributeCollection containing the attributes of this node.
XmlAttributeCollection
containing the attributes of the node.If the node is of type XmlNodeType.Element, the attributes of the node are returned. Otherwise, this property returns null
.Definition at line 99 of file XmlNode.cs.
virtual XmlNodeList System.Xml.XmlNode.ChildNodes => new XmlChildNodes(this) |
Gets all the child nodes of the node.
Definition at line 87 of file XmlNode.cs.
virtual XmlNode System.Xml.XmlNode.FirstChild => LastNode?.next |
Gets the first child of the node.
null
is returned.Definition at line 117 of file XmlNode.cs.
virtual bool System.Xml.XmlNode.HasChildNodes => LastNode != null |
Gets a value indicating whether this node has any child nodes.
true
if the node has child nodes; otherwise, false
.Definition at line 139 of file XmlNode.cs.
virtual XmlNode System.Xml.XmlNode.LastChild => LastNode |
Gets the last child of the node.
null
is returned.Definition at line 121 of file XmlNode.cs.
virtual string System.Xml.XmlNode.NamespaceURI => string.Empty |
Gets the namespace URI of this node.
Definition at line 143 of file XmlNode.cs.
virtual XmlNode System.Xml.XmlNode.NextSibling => null |
Gets the node immediately following this node.
XmlNode
. If there is no next node, null
is returned.Definition at line 95 of file XmlNode.cs.
virtual XmlNode System.Xml.XmlNode.PreviousSibling => null |
Gets the node immediately preceding this node.
XmlNode
. If there is no preceding node, null
is returned.Definition at line 91 of file XmlNode.cs.
virtual XmlNode System.Xml.XmlNode.PreviousText => null |
Gets the text node that immediately precedes this node.
Definition at line 397 of file XmlNode.cs.
virtual IXmlSchemaInfo System.Xml.XmlNode.SchemaInfo => XmlDocument.NotKnownSchemaInfo |
Gets the post schema validation infoset that has been assigned to this node as a result of schema validation.
Definition at line 268 of file XmlNode.cs.
|
get |
Gets the base URI of the current node.
Definition at line 273 of file XmlNode.cs.
|
getset |
Gets or sets the concatenated values of the node and all its child nodes.
Definition at line 182 of file XmlNode.cs.
|
getset |
Gets or sets the markup representing only the child nodes of this node.
InnerXml
does not return default attributes.T:System.InvalidOperationException | Setting this property on a node that cannot have child nodes. |
T:System.Xml.XmlException | The XML specified when setting this property is not well-formed. |
Definition at line 245 of file XmlNode.cs.
|
get |
Gets a value indicating whether the node is read-only.
true
if the node is read-only; otherwise false
.Definition at line 171 of file XmlNode.cs.
|
get |
Gets the local name of the node, when overridden in a derived class.
LocalName
is book for the element <bk:book>.The name returned is dependent on the P:System.Xml.XmlNode.NodeType of the node: Type Name Attribute The local name of the attribute. CDATA #cdata-section Comment #comment Document #document DocumentFragment #document-fragment DocumentType The document type name. Element The local name of the element. Entity The name of the entity. EntityReference The name of the entity referenced. Notation The notation name. ProcessingInstruction The target of the processing instruction. Text #text Whitespace #whitespace SignificantWhitespace #significant-whitespace XmlDeclaration #xml-declaration Definition at line 163 of file XmlNode.cs.
|
get |
Gets the qualified name of the node, when overridden in a derived class.
Definition at line 20 of file XmlNode.cs.
|
get |
Gets the type of the current node, when overridden in a derived class.
Definition at line 53 of file XmlNode.cs.
|
get |
Gets the markup containing this node and all its child nodes.
OuterXml
does not return default attributes.Definition at line 222 of file XmlNode.cs.
|
get |
Gets the T:System.Xml.XmlDocument to which this node belongs.
null
.Definition at line 104 of file XmlNode.cs.
|
get |
Gets the parent of this node (for nodes that can have parents).
XmlNode
that is the parent of the current node. If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null
. For all other nodes, the value returned depends on the P:System.Xml.XmlNode.NodeType of the node. The following table describes the possible return values for the ParentNode
property.NodeType Return Value of ParentNode Attribute, Document, DocumentFragment, Entity, Notation Returns null
; these nodes do not have parents. CDATA Returns the element or entity reference containing the CDATA section. Comment Returns the element, entity reference, document type, or document containing the comment. DocumentType Returns the document node. Element Returns the parent node of the element. If the element is the root node in the tree, the parent is the document node. EntityReference Returns the element, attribute, or entity reference containing the entity reference. ProcessingInstruction Returns the document, element, document type, or entity reference containing the processing instruction. Text Returns the parent element, attribute, or entity reference containing the text node. Definition at line 60 of file XmlNode.cs.
|
getset |
Gets or sets the namespace prefix of this node.
Prefix
is bk for the element <bk:book>. If there is no prefix, this property returns String.Empty.T:System.ArgumentException | This node is read-only. |
T:System.Xml.XmlException | The specified prefix contains an invalid character.The specified prefix is malformed.The specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace".This node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/ ".This node is an attribute and the qualifiedName of this node is "xmlns". |
Definition at line 150 of file XmlNode.cs.
|
get |
Gets the first child element with the specified P:System.Xml.XmlNode.LocalName and P:System.Xml.XmlNode.NamespaceURI.
localname | The local name of the element. |
ns | The namespace URI of the element. |
Nothing
in Visual Basic) if there is no match.Definition at line 327 of file XmlNode.cs.
|
get |
Gets the first child element with the specified P:System.Xml.XmlNode.Name.
name | The qualified name of the element to retrieve. |
Nothing
in Visual Basic) if there is no match.Definition at line 308 of file XmlNode.cs.
|
getset |
Gets or sets the value of the node.
null
. DocumentFragment null
. DocumentType null
. Element null
. You can use the P:System.Xml.XmlElement.InnerText or P:System.Xml.XmlElement.InnerXml properties to access the value of the element node. Entity null
. EntityReference null
. Notation null
. ProcessingInstruction The entire content excluding the target. Text The content of the text node. SignificantWhitespace The white space characters. White space can consist of one or more space characters, carriage returns, line feeds, or tabs. Whitespace The white space characters. White space can consist of one or more space characters, carriage returns, line feeds, or tabs. XmlDeclaration The content of the declaration (that is, everything between <?xml and ?>). T:System.ArgumentException | Setting the value of a node that is read-only. |
T:System.InvalidOperationException | Setting the value of a node that is not supposed to have a value (for example, an Element node). |
Definition at line 36 of file XmlNode.cs.