XmlNamedNodeMap class

XmlNamedNodeMap class

Encapsulates iteration through the collection of attribute nodes.

Syntax


var xmlNamedNodeMap = XmlDocument.attributes;

Members

The XmlNamedNodeMap class has these types of members:

Methods

The XmlNamedNodeMap class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
First [C++, JavaScript]Returns an iterator that iterates over the items in the collection.
GetAt [C++, JavaScript]Returns the item at the specified index in the vector view.
GetMany [C++, JavaScript]Returns the items that start at the specified index of the vector view.
GetNamedItem Retrieves the attribute with the specified name.
GetNamedItemNS Retrieves the attribute with the specified namespace and name.
IndexOf [C++, JavaScript]Returns the index of a specified item in the vector view.
Item [C++, JavaScript]Allows random access to individual nodes within the collection.
RemoveNamedItem Removes the specified item.
RemoveNamedItemNS Removes an item that is specified by a namespace and local name.
SetNamedItem Adds the specified node to the collection.
SetNamedItemNS Adds the specified node to the collection in the specified namespace.

 

Properties

The XmlNamedNodeMap class has these properties.

PropertyAccess typeDescription

Count [C#, VB]

Read-only

Gets the number of elements contained in the collection.

Item [C#, VB]

Read-only

Gets or sets the element at the specified index.

Length

Read-only

Gets the length of the list of nodes.

Size [C++, JavaScript]

Read-only

Gets the number of elements in the vector view.

 

Remarks

Collection member lists

For JavaScript, XmlNamedNodeMap has the members shown in the member lists. In addition, XmlNamedNodeMap supports members of Array.prototype and using an index to access items.

Enumerating the collection in C# or Microsoft Visual Basic

XmlNamedNodeMap is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<IXmlNode> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with an IXmlNode constraint.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Data.Xml.Dom
Windows::Data::Xml::Dom [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Data.Xml.Dom
Windows::Data::Xml::Dom [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

See also

Object
IVectorView(IXmlNode)
IIterable(IXmlNode)

 

 

Show:
© 2017 Microsoft