IXMLDOMNode.nodeName (Visual Basic .NET)
Previous | Next |
IXMLDOMNode.nodeName (Visual Basic .NET)
The nodeName property contains the qualified name of the element, attribute, or entity reference, or a fixed string for other node types.
Syntax
String = IXMLDOMNode.nodeName
Remarks
The property is read-only and always contains a non-empty string. The nodeName property contains the name for the element, attribute, or entity reference.
The value of the string returned depends on the type of node on which the nodeName property is called, as shown in the following table. For example, if the node type is NODE_ELEMENT, a string is returned containing the name of the XML tag for that element node.
Value | Description |
NODE_ATTRIBUTE | Contains the name of the attribute. |
NODE_COMMENT | Contains the literal string "#comment". |
NODE_DOCUMENT | Contains the literal string "#document". |
NODE_ELEMENT | Contains the name of the XML tag, with any namespace prefix included if present. |
NODE_PROCESSING_INSTRUCTION | Contains the target; the first token following the <? characters. |
NODE_TEXT | Contains the literal string "#text". |
Example Code
The following example creates an IXMLDOMNode object and displays its name.
Imports interop_msxml Imports Microsoft.WindowsMediaServices.Interop On Error GoTo Err ' Declare variables. Dim Server As New WMSServerClass() Dim Playlist As IXMLDOMDocument Dim currNode As IXMLDOMNode ' Create a new playlist object. Set Playlist = Server.CreatePlaylist ' Load a playlist. Playlist.Load ("file://c:\wmpub\wmroot\simple.wsx") ' Retrieve the first child node of the root element and ' display its node name. Set currNode = Playlist.documentElement.childNodes.Item(0) MsgBox currNode.nodeName 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 |