XmlNamedNodeMap XmlNamedNodeMap XmlNamedNodeMap XmlNamedNodeMap Class

Definition

Encapsulates iteration through the collection of attribute nodes.

public : sealed class XmlNamedNodeMap : IXmlNamedNodeMap, IIterable<IXmlNode>, IVectorView<IXmlNode>
public sealed class XmlNamedNodeMap : IXmlNamedNodeMap, IEnumerable<IXmlNode>, IReadOnlyList<IXmlNode>
Public NotInheritable Class XmlNamedNodeMap Implements IXmlNamedNodeMap, IEnumerable<IXmlNode>, IReadOnlyList<IXmlNode>
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 with an IXmlNode constraint.

Properties

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets the element at the specified index in the read-only list.

This member is not implemented in C++
T this[int index] { get; }
ReadOnly Property Item(index As Integer) As T
T this[int index] { get; }
Parameters
index

The zero-based index of the element to get.

Value
T T T T

The element at the specified index in the read-only list.

Length Length Length Length

Gets the length of the list of nodes.

public : unsigned int Length { get; }
public uint Length { get; }
Public ReadOnly Property Length As uint
var uint = xmlNamedNodeMap.length;
Value
unsigned int uint uint uint

The number of nodes in the list.

Remarks

The range of valid child node indices is 0 to length-1 inclusive.

Size Size Size Size

Gets the number of elements in the vector view.

public : unsigned int Size { get; }
This member is not implemented in C#
This member is not implemented in VB.Net
var uint = xmlNamedNodeMap.size;
Value
unsigned int uint uint uint

The number of elements in the vector view.

Methods

First() First() First() First()

Returns an iterator that iterates over the items in the collection.

public : IIterator<IXmlNode> First()
This member is not implemented in C#
This member is not implemented in VB.Net
var iIterator = xmlNamedNodeMap.first();
Returns

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the item at the specified index in the vector view.

public : IXmlNode GetAt(unsigned int index)
This member is not implemented in C#
This member is not implemented in VB.Net
var iXmlNode = xmlNamedNodeMap.getAt(index);
Parameters
index
unsigned int UInt32 UInt32 UInt32

The zero-based index of the item in the vector view to return.

Returns

The item in the vector view at the specified index.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the collection.

This member is not implemented in C++
IEnumerator<T> GetEnumerator()
Function GetEnumerator As IEnumerator(Of T)
IEnumerator<T> GetEnumerator()
Returns

An enumerator that can be used to iterate through the collection.

GetMany(UInt32, IXmlNode[]) GetMany(UInt32, IXmlNode[]) GetMany(UInt32, IXmlNode[]) GetMany(UInt32, IXmlNode[])

Returns the items that start at the specified index of the vector view.

public : unsigned int GetMany(unsigned int startIndex, IXmlNode[] items)
This member is not implemented in C#
This member is not implemented in VB.Net
var uint = xmlNamedNodeMap.getMany(startIndex, items);
Parameters
startIndex
unsigned int UInt32 UInt32 UInt32

The zero-based index of the start of the items in the vector to return.

items
IXmlNode[] IXmlNode[] IXmlNode[] IXmlNode[]

The items in the vector view that start at startIndex.

Returns
unsigned int uint uint uint

The number of items returned.

GetNamedItem(String) GetNamedItem(String) GetNamedItem(String) GetNamedItem(String)

Retrieves the attribute with the specified name.

public : IXmlNode GetNamedItem(Platform::String name)
public IXmlNode GetNamedItem(String name)
Public Function GetNamedItem(name As String) As IXmlNode
var iXmlNode = xmlNamedNodeMap.getNamedItem(name);
Parameters
name
Platform::String String String String

The name of the attribute.

Returns

The returned attribute with the specified name. This method returns Null if the attribute node is not in this collection.

GetNamedItemNS(Object, String) GetNamedItemNS(Object, String) GetNamedItemNS(Object, String) GetNamedItemNS(Object, String)

Retrieves the attribute with the specified namespace and name.

public : IXmlNode GetNamedItemNS(Platform::Object namespaceUri, Platform::String name)
public IXmlNode GetNamedItemNS(Object namespaceUri, String name)
Public Function GetNamedItemNS(namespaceUri As Object, name As String) As IXmlNode
var iXmlNode = xmlNamedNodeMap.getNamedItemNS(namespaceUri, name);
Parameters
namespaceUri
Platform::Object Object Object Object

The namespace name of the attribute.

name
Platform::String String String String

The name of the attribute.

Returns

The attribute with the specified namespace and name. This method returns Null if the attribute node is not in this collection.

IndexOf(IXmlNode, UInt32) IndexOf(IXmlNode, UInt32) IndexOf(IXmlNode, UInt32) IndexOf(IXmlNode, UInt32)

Returns the index of a specified item in the vector view.

public : Platform::Boolean IndexOf(IXmlNode value, unsigned int index)
This member is not implemented in C#
This member is not implemented in VB.Net
var bool = xmlNamedNodeMap.indexOf(value, index);
Parameters
value
IXmlNode IXmlNode IXmlNode IXmlNode

The item to find in the vector view.

index
unsigned int UInt32 UInt32 UInt32

The zero-based index of the item if found. Zero is returned if the item is not found.

Returns
Platform::Boolean bool bool bool

TRUE if the item is found; otherwise, FALSE if it is not found.

Item(UInt32) Item(UInt32) Item(UInt32) Item(UInt32)

Allows random access to individual nodes within the collection.

public : IXmlNode Item(unsigned int index)
public IXmlNode Item(UInt32 index)
Public Function Item(index As UInt32) As IXmlNode
var iXmlNode = xmlNamedNodeMap.item(index);
Parameters
index
unsigned int UInt32 UInt32 UInt32

The index of the item within the collection. The first item is zero.

Returns

The object to access. This method returns null if the index is out of range.

Remarks

Microsoft .NET For C# and Microsoft Visual Basic, XmlNamedNodeMap has a property named Item (not a method). That property is the Microsoft .NET indexer property for the collection and also supports a set syntax. For more info and the usage syntax see Item.

RemoveNamedItem(String) RemoveNamedItem(String) RemoveNamedItem(String) RemoveNamedItem(String)

Removes the specified item.

public : IXmlNode RemoveNamedItem(Platform::String name)
public IXmlNode RemoveNamedItem(String name)
Public Function RemoveNamedItem(name As String) As IXmlNode
var iXmlNode = xmlNamedNodeMap.removeNamedItem(name);
Parameters
name
Platform::String String String String

The name of the attribute to remove from the collection.

Returns

The node removed from the collection. This method returns Null if the named node is not an attribute.

RemoveNamedItemNS(Object, String) RemoveNamedItemNS(Object, String) RemoveNamedItemNS(Object, String) RemoveNamedItemNS(Object, String)

Removes an item that is specified by a namespace and local name.

public : IXmlNode RemoveNamedItemNS(Platform::Object namespaceUri, Platform::String name)
public IXmlNode RemoveNamedItemNS(Object namespaceUri, String name)
Public Function RemoveNamedItemNS(namespaceUri As Object, name As String) As IXmlNode
var iXmlNode = xmlNamedNodeMap.removeNamedItemNS(namespaceUri, name);
Parameters
namespaceUri
Platform::Object Object Object Object

The namespace name of the attribute.

name
Platform::String String String String

The name of the attribute.

Returns

The node removed from the collection. This method returns Null if the named node is not an attribute.

SetNamedItem(IXmlNode) SetNamedItem(IXmlNode) SetNamedItem(IXmlNode) SetNamedItem(IXmlNode)

Adds the specified node to the collection.

public : IXmlNode SetNamedItem(IXmlNode node)
public IXmlNode SetNamedItem(IXmlNode node)
Public Function SetNamedItem(node As IXmlNode) As IXmlNode
var iXmlNode = xmlNamedNodeMap.setNamedItem(node);
Parameters
node
IXmlNode IXmlNode IXmlNode IXmlNode

The node to add to the collection.

Returns

The attribute successfully added to the collection. If Null, no object is created.

SetNamedItemNS(IXmlNode) SetNamedItemNS(IXmlNode) SetNamedItemNS(IXmlNode) SetNamedItemNS(IXmlNode)

Adds the specified node to the collection in the specified namespace. If you are not using any namespaces, then use the SetNamedItem method.

public : IXmlNode SetNamedItemNS(IXmlNode node)
public IXmlNode SetNamedItemNS(IXmlNode node)
Public Function SetNamedItemNS(node As IXmlNode) As IXmlNode
var iXmlNode = xmlNamedNodeMap.setNamedItemNS(node);
Parameters
node
IXmlNode IXmlNode IXmlNode IXmlNode

The node to add to the collection.

Note

You set the namespace when you create the node using the CreateAttributeNS or CreateElementNS methods.

Returns

The attribute successfully added to the collection. If Null, no object is created.