Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Xml.​XmlAttributeCollection

Assembly: System.Xml.ReaderWriter

Inheritance: object → XmlNamedNodeMap → XmlAttributeCollection

Implemented Interfaces

Represents a collection of attributes that can be accessed by name or index.

Properties

public XmlAttribute
ItemOf
public XmlAttribute
ItemOf
public XmlAttribute
ItemOf
public int
Count
Gets the number of nodes in the <see langword="XmlNamedNodeMap" /> .

Methods

public XmlAttribute
Append​(XmlAttribute node)
Inserts the specified attribute as the last node in the collection.
Returns The <see langword="XmlAttribute" /> to append to the collection.
node The attribute to insert.
public void
CopyTo​(XmlAttribute[] array, int index)
Copies all the <see cref="T:System.Xml.XmlAttribute" /> objects from this collection into the given array.
array The array that is the destination of the objects copied from this collection.
index The index in the array where copying begins.
public XmlAttribute
InsertAfter​(XmlAttribute newNode, XmlAttribute? refNode)
Inserts the specified attribute immediately after the specified reference attribute.
Returns The <see langword="XmlAttribute" /> to insert into the collection.
newNode The attribute to insert.
refNode The reference attribute. <paramref name="newNode" /> is placed after the <paramref name="refNode" /> .
public XmlAttribute
InsertBefore​(XmlAttribute newNode, XmlAttribute? refNode)
Inserts the specified attribute immediately before the specified reference attribute.
Returns The <see langword="XmlAttribute" /> to insert into the collection.
newNode The attribute to insert.
refNode The reference attribute. <paramref name="newNode" /> is placed before the <paramref name="refNode" /> .
public XmlAttribute
Prepend​(XmlAttribute node)
Inserts the specified attribute as the first node in the collection.
Returns The <see langword="XmlAttribute" /> added to the collection.
node The attribute to insert.
public XmlAttribute
Remove​(XmlAttribute node)
Removes the specified attribute from the collection.
Returns The node removed or <see langword="null" /> if it is not found in the collection.
node The attribute to remove.
public void
RemoveAll​()
Removes all attributes from the collection.
public XmlAttribute
RemoveAt​(int i)
Removes the attribute corresponding to the specified index from the collection.
Returns Returns <see langword="null" /> if there is no attribute at the specified index.
i The index of the node to remove. The first node has index 0.
public XmlNode
SetNamedItem​(XmlNode node)
Adds a <see cref="T:System.Xml.XmlNode" /> using its <see cref="P:System.Xml.XmlNode.Name" /> property.
Returns If the <paramref name="node" /> replaces an existing node with the same name, the old node is returned; otherwise, the added node is returned.
node An attribute node to store in this collection. The node will later be accessible using the name of the node. If a node with that name is already present in the collection, it is replaced by the new one; otherwise, the node is appended to the end of the collection.
GetEnumerator​()
Inherited from XmlNamedNodeMap
Provides support for the "foreach" style iteration over the collection of nodes in the <see langword="XmlNamedNodeMap" /> .
Returns An enumerator object.
public XmlNode
GetNamedItem​(string name)
Inherited from XmlNamedNodeMap
Retrieves an <see cref="T:System.Xml.XmlNode" /> specified by name.
Returns An <see langword="XmlNode" /> with the specified name or <see langword="null" /> if a matching node is not found.
name The qualified name of the node to retrieve. It is matched against the <see cref="P:System.Xml.XmlNode.Name" /> property of the matching node.
public XmlNode
GetNamedItem​(string localName, string namespaceURI)
Inherited from XmlNamedNodeMap
Retrieves a node with the matching <see cref="P:System.Xml.XmlNode.LocalName" /> and <see cref="P:System.Xml.XmlNode.NamespaceURI" /> .
Returns An <see cref="T:System.Xml.XmlNode" /> with the matching local name and namespace URI or <see langword="null" /> if a matching node was not found.
localName The local name of the node to retrieve.
namespaceURI The namespace Uniform Resource Identifier (URI) of the node to retrieve.
public XmlNode
Item​(int index)
Inherited from XmlNamedNodeMap
Retrieves the node at the specified index in the <see langword="XmlNamedNodeMap" /> .
Returns The <see cref="T:System.Xml.XmlNode" /> at the specified index. If <paramref name="index" /> is less than 0 or greater than or equal to the <see cref="P:System.Xml.XmlNamedNodeMap.Count" /> property, <see langword="null" /> is returned.
index The index position of the node to retrieve from the <see langword="XmlNamedNodeMap" /> . The index is zero-based; therefore, the index of the first node is 0 and the index of the last node is <see cref="P:System.Xml.XmlNamedNodeMap.Count" /> -1.
public XmlNode
RemoveNamedItem​(string name)
Inherited from XmlNamedNodeMap
Removes the node from the <see langword="XmlNamedNodeMap" /> .
Returns The <see langword="XmlNode" /> removed from this <see langword="XmlNamedNodeMap" /> or <see langword="null" /> if a matching node was not found.
name The qualified name of the node to remove. The name is matched against the <see cref="P:System.Xml.XmlNode.Name" /> property of the matching node.
public XmlNode
RemoveNamedItem​(string localName, string namespaceURI)
Inherited from XmlNamedNodeMap
Removes a node with the matching <see cref="P:System.Xml.XmlNode.LocalName" /> and <see cref="P:System.Xml.XmlNode.NamespaceURI" /> .
Returns The <see cref="T:System.Xml.XmlNode" /> removed or <see langword="null" /> if a matching node was not found.
localName The local name of the node to remove.
namespaceURI The namespace URI of the node to remove.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object