mscorlib(4.0.0.0) API with additions
|
Represents an element. More...
Public Member Functions | |
override XmlNode | CloneNode (bool deep) |
Creates a duplicate of this node. More... | |
virtual string | GetAttribute (string name) |
Returns the value for the attribute with the specified name. More... | |
virtual void | SetAttribute (string name, string value) |
Sets the value of the attribute with the specified name. More... | |
virtual void | RemoveAttribute (string name) |
Removes an attribute by name. More... | |
virtual XmlAttribute | GetAttributeNode (string name) |
Returns the XmlAttribute with the specified name. More... | |
virtual XmlAttribute | SetAttributeNode (XmlAttribute newAttr) |
Adds the specified T:System.Xml.XmlAttribute. More... | |
virtual XmlAttribute | RemoveAttributeNode (XmlAttribute oldAttr) |
Removes the specified T:System.Xml.XmlAttribute. More... | |
virtual XmlNodeList | GetElementsByTagName (string name) |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlElement.Name. More... | |
virtual string | GetAttribute (string localName, string namespaceURI) |
Returns the value for the attribute with the specified local name and namespace URI. More... | |
virtual string | SetAttribute (string localName, string namespaceURI, string value) |
Sets the value of the attribute with the specified local name and namespace URI. More... | |
virtual void | RemoveAttribute (string localName, string namespaceURI) |
Removes an attribute with the specified local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced). More... | |
virtual XmlAttribute | GetAttributeNode (string localName, string namespaceURI) |
Returns the T:System.Xml.XmlAttribute with the specified local name and namespace URI. More... | |
virtual XmlAttribute | SetAttributeNode (string localName, string namespaceURI) |
Adds the specified T:System.Xml.XmlAttribute. More... | |
virtual XmlAttribute | RemoveAttributeNode (string localName, string namespaceURI) |
Removes the T:System.Xml.XmlAttribute specified by the local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced). More... | |
virtual XmlNodeList | GetElementsByTagName (string localName, string namespaceURI) |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlElement.LocalName and P:System.Xml.XmlElement.NamespaceURI. More... | |
virtual bool | HasAttribute (string name) |
Determines whether the current node has an attribute with the specified name. More... | |
virtual bool | HasAttribute (string localName, string namespaceURI) |
Determines whether the current node has an attribute with the specified local name and namespace URI. More... | |
override void | WriteTo (XmlWriter w) |
Saves the current node to the specified T:System.Xml.XmlWriter. More... | |
override void | WriteContentTo (XmlWriter w) |
Saves all the children of the node to the specified T:System.Xml.XmlWriter. More... | |
virtual XmlNode | RemoveAttributeAt (int i) |
Removes the attribute node with the specified index from the element. (If the removed attribute has a default value, it is immediately replaced). More... | |
virtual void | RemoveAllAttributes () |
Removes all specified attributes from the element. Default attributes are not removed. More... | |
override void | RemoveAll () |
Removes all specified attributes and children of the current node. Default attributes are not removed. More... | |
![]() | |
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... | |
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... | |
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 | |
override string | Name => name.Name |
Gets the qualified name of the node. More... | |
override string | LocalName => name.LocalName |
Gets the local name of the current node. More... | |
override string | NamespaceURI => name.NamespaceURI |
Gets the namespace URI of this node. More... | |
override XmlNodeType | NodeType => XmlNodeType.Element |
Gets the type of the current node. More... | |
override XmlNode | ParentNode => parentNode |
Gets the parent of this node (for nodes that can have parents). More... | |
override XmlDocument | OwnerDocument => name.OwnerDocument |
Gets the T:System.Xml.XmlDocument to which this node belongs. More... | |
override IXmlSchemaInfo | SchemaInfo => name |
Gets the post schema validation infoset that has been assigned to this node as a result of schema validation. More... | |
![]() | |
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... | |
Protected Member Functions | |
internal | XmlElement (string prefix, string localName, string namespaceURI, XmlDocument doc) |
Initializes a new instance of the T:System.Xml.XmlElement class. More... | |
Properties | |
override string | Prefix [get, set] |
Gets or sets the namespace prefix of this node. More... | |
bool | IsEmpty [get, set] |
Gets or sets the tag format of the element. More... | |
override XmlAttributeCollection | Attributes [get] |
Gets an T:System.Xml.XmlAttributeCollection containing the list of attributes for this node. More... | |
virtual bool | HasAttributes [get] |
Gets a boolean value indicating whether the current node has any attributes. More... | |
override string | InnerXml [get, set] |
Gets or sets the markup representing just the children of this node. More... | |
override string | InnerText [get, set] |
Gets or sets the concatenated values of the node and all its children. More... | |
override XmlNode | NextSibling [get] |
Gets the T:System.Xml.XmlNode immediately following this element. More... | |
![]() | |
override XmlNode | PreviousSibling [get] |
Gets the node immediately preceding this node. More... | |
override XmlNode | NextSibling [get] |
Gets the node immediately following this node. More... | |
![]() | |
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 an element.
Definition at line 7 of file XmlElement.cs.
|
protected |
Initializes a new instance of the T:System.Xml.XmlElement class.
prefix | The namespace prefix; see the P:System.Xml.XmlElement.Prefix property. |
localName | The local name; see the P:System.Xml.XmlElement.LocalName property. |
namespaceURI | The namespace URI; see the P:System.Xml.XmlElement.NamespaceURI property. |
doc | The parent XML document. |
Definition at line 231 of file XmlElement.cs.
|
virtual |
Creates a duplicate of this node.
deep | true to recursively clone the subtree under the specified node; false to clone only the node itself (and its attributes if the node is an XmlElement ). |
Implements System.Xml.XmlNode.
Definition at line 240 of file XmlElement.cs.
|
virtual |
Returns the value for the attribute with the specified name.
name | The name of the attribute to retrieve. This is a qualified name. It is matched against the Name property of the matching node. |
Definition at line 327 of file XmlElement.cs.
|
virtual |
Returns the value for the attribute with the specified local name and namespace URI.
localName | The local name of the attribute to retrieve. |
namespaceURI | The namespace URI of the attribute to retrieve. |
Definition at line 419 of file XmlElement.cs.
|
virtual |
Returns the XmlAttribute
with the specified name.
name | The name of the attribute to retrieve. This is a qualified name. It is matched against the Name property of the matching node. |
XmlAttribute
or null
if a matching attribute was not found.Definition at line 371 of file XmlElement.cs.
|
virtual |
Returns the T:System.Xml.XmlAttribute with the specified local name and namespace URI.
localName | The local name of the attribute. |
namespaceURI | The namespace URI of the attribute. |
XmlAttribute
or null
if a matching attribute was not found.Definition at line 463 of file XmlElement.cs.
|
virtual |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlElement.Name.
name | The name tag to match. This is a qualified name. It is matched against the Name property of the matching node. The asterisk (*) is a special value that matches all tags. |
Definition at line 410 of file XmlElement.cs.
|
virtual |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlElement.LocalName and P:System.Xml.XmlElement.NamespaceURI.
localName | The local name to match. The asterisk (*) is a special value that matches all tags. |
namespaceURI | The namespace URI to match. |
Definition at line 507 of file XmlElement.cs.
|
virtual |
Determines whether the current node has an attribute with the specified name.
name | The name of the attribute to find. This is a qualified name. It is matched against the Name property of the matching node. |
true
if the current node has the specified attribute; otherwise, false
.Definition at line 516 of file XmlElement.cs.
|
virtual |
Determines whether the current node has an attribute with the specified local name and namespace URI.
localName | The local name of the attribute to find. |
namespaceURI | The namespace URI of the attribute to find. |
true
if the current node has the specified attribute; otherwise, false
.Definition at line 526 of file XmlElement.cs.
|
virtual |
Removes all specified attributes and children of the current node. Default attributes are not removed.
Reimplemented from System.Xml.XmlNode.
Definition at line 638 of file XmlElement.cs.
|
virtual |
Removes all specified attributes from the element. Default attributes are not removed.
Definition at line 629 of file XmlElement.cs.
|
virtual |
Removes an attribute by name.
name | The name of the attribute to remove.This is a qualified name. It is matched against the Name property of the matching node. |
T:System.ArgumentException | The node is read-only. |
Definition at line 360 of file XmlElement.cs.
|
virtual |
Removes an attribute with the specified local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced).
localName | The local name of the attribute to remove. |
namespaceURI | The namespace URI of the attribute to remove. |
T:System.ArgumentException | The node is read-only. |
Definition at line 454 of file XmlElement.cs.
|
virtual |
Removes the attribute node with the specified index from the element. (If the removed attribute has a default value, it is immediately replaced).
i | The index of the node to remove. The first node has index 0. |
null
if there is no node at the given index.Definition at line 619 of file XmlElement.cs.
|
virtual |
Removes the specified T:System.Xml.XmlAttribute.
oldAttr | The XmlAttribute node to remove. If the removed attribute has a default value, it is immediately replaced. |
XmlAttribute
or null
if oldAttr is not an attribute node of the XmlElement
.T:System.ArgumentException | This node is read-only. |
Definition at line 398 of file XmlElement.cs.
|
virtual |
Removes the T:System.Xml.XmlAttribute specified by the local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced).
localName | The local name of the attribute. |
namespaceURI | The namespace URI of the attribute. |
XmlAttribute
or null
if the XmlElement
does not have a matching attribute node.T:System.ArgumentException | This node is read-only. |
Definition at line 492 of file XmlElement.cs.
|
virtual |
Sets the value of the attribute with the specified name.
name | The name of the attribute to create or alter. This is a qualified name. If the name contains a colon it is parsed into prefix and local name components. |
value | The value to set for the attribute. |
T:System.Xml.XmlException | The specified name contains an invalid character. |
T:System.ArgumentException | The node is read-only. |
Definition at line 342 of file XmlElement.cs.
|
virtual |
Sets the value of the attribute with the specified local name and namespace URI.
localName | The local name of the attribute. |
namespaceURI | The namespace URI of the attribute. |
value | The value to set for the attribute. |
Definition at line 434 of file XmlElement.cs.
|
virtual |
Adds the specified T:System.Xml.XmlAttribute.
newAttr | The XmlAttribute node to add to the attribute collection for this element. |
XmlAttribute
is returned; otherwise, null
is returned.T:System.ArgumentException | The newAttr was created from a different document than the one that created this node. Or this node is read-only. |
T:System.InvalidOperationException | The newAttr is already an attribute of another XmlElement object. You must explicitly clone XmlAttribute nodes to re-use them in other XmlElement objects. |
Definition at line 385 of file XmlElement.cs.
|
virtual |
Adds the specified T:System.Xml.XmlAttribute.
localName | The local name of the attribute. |
namespaceURI | The namespace URI of the attribute. |
XmlAttribute
to add.Definition at line 476 of file XmlElement.cs.
|
virtual |
Saves all the children of the node to the specified T:System.Xml.XmlWriter.
w | The XmlWriter to which you want to save. |
Implements System.Xml.XmlNode.
Definition at line 608 of file XmlElement.cs.
|
virtual |
Saves the current node to the specified T:System.Xml.XmlWriter.
w | The XmlWriter to which you want to save. |
Implements System.Xml.XmlNode.
Definition at line 533 of file XmlElement.cs.
override string System.Xml.XmlElement.LocalName => name.LocalName |
Gets the local name of the current node.
LocalName
is book for the element <bk:book>.Definition at line 33 of file XmlElement.cs.
override string System.Xml.XmlElement.Name => name.Name |
Gets the qualified name of the node.
XmlElement
nodes, this is the tag name of the element.Definition at line 29 of file XmlElement.cs.
override string System.Xml.XmlElement.NamespaceURI => name.NamespaceURI |
Gets the namespace URI of this node.
Definition at line 37 of file XmlElement.cs.
override XmlNodeType System.Xml.XmlElement.NodeType => XmlNodeType.Element |
Gets the type of the current node.
XmlElement
nodes, this value is XmlNodeType.Element.Definition at line 57 of file XmlElement.cs.
override XmlDocument System.Xml.XmlElement.OwnerDocument => name.OwnerDocument |
Gets the T:System.Xml.XmlDocument to which this node belongs.
XmlDocument
to which this element belongs.Definition at line 65 of file XmlElement.cs.
override XmlNode System.Xml.XmlElement.ParentNode => parentNode |
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.Definition at line 61 of file XmlElement.cs.
override IXmlSchemaInfo System.Xml.XmlElement.SchemaInfo => name |
Gets the post schema validation infoset that has been assigned to this node as a result of schema validation.
Definition at line 148 of file XmlElement.cs.
|
get |
Gets an T:System.Xml.XmlAttributeCollection containing the list of attributes for this node.
Definition at line 114 of file XmlElement.cs.
|
get |
Gets a boolean
value indicating whether the current node has any attributes.
true
if the current node has attributes; otherwise, false
.Definition at line 135 of file XmlElement.cs.
|
getset |
Gets or sets the concatenated values of the node and all its children.
Definition at line 170 of file XmlElement.cs.
|
getset |
Gets or sets the markup representing just the children of this node.
T:System.Xml.XmlException | The XML specified when setting this property is not well-formed. |
Definition at line 154 of file XmlElement.cs.
|
getset |
Gets or sets the tag format of the element.
true
if the element is to be serialized in the short tag format "<item/>"; false
for the long format "<item></item>".When setting this property, if set to true
, the children of the element are removed and the element is serialized in the short tag format. If set to false
, the value of the property is changed (regardless of whether or not the element has content); if the element is empty, it is serialized in the long format.This property is a Microsoft extension to the Document Object Model (DOM).Definition at line 72 of file XmlElement.cs.
|
get |
Gets the T:System.Xml.XmlNode immediately following this element.
XmlNode
immediately following this element.Definition at line 191 of file XmlElement.cs.
|
getset |
Gets or sets the namespace prefix of this node.
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 namespaceURI of this node is null .The specified prefix is "xml" and the namespaceURI of this node is different from http://www.w3.org/XML/1998/namespace. |
Definition at line 44 of file XmlElement.cs.