IXMLDOMNamedNodeMap.length (Visual Basic .NET)

banner art

Previous Next

IXMLDOMNamedNodeMap.length (Visual Basic .NET)

The length property indicates the number of items in the IXMLDOMNamedNodeMap collection.

Syntax

  Integer = IXMLDOMNamedNodeMap
  .length

Remarks

The property is read-only.

Example Code

The following example creates an IXMLDOMNamedNodeMap object and then uses its length property to support iteration.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

' Declare variables.
Dim Server As New WMSServerClass()
Dim Playlist As IXMLDOMDocument()
Dim nodeList As MSXML2.IXMLDOMNodeList
Dim Node As MSXML2.IXMLDOMNode
Dim namedNodeMap As MSXML2.IXMLDOMNamedNodeMap
Dim I As Integer

' Create a new playlist object.
Set Playlist = Server.CreatePlaylist

' Load a playlist.
Playlist.load("file://e:\wmpub\wmroot\simple.wsx")

' Retrieve all attributes that appear in the first
' element with the node name "media" and display
' the total count.
nodeList = Playlist.getElementsByTagName("media")
Node = nodeList.item(0)
namedNodeMap = Node.attributes

' Display the node value associated with each attribute 
' in the collection.
For I = 0 To namedNodeMap.length - 1
    MsgBox(namedNodeMap.item(I).nodeValue)
Next
Exit Sub

Err:
        ' TODO: Handle errors.

Requirements

Reference: Add references to Microsoft.WindowsMediaServices and interop_msxml.

Namespace: Microsoft.WindowsMediaServices.Interop, interop_msxml.

Assembly: Microsoft.WindowsMediaServices.dll, interop_msxml.dll.

Library: WMSServerTypeLib.dll, msxml.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next