IXMLDOMNode.nodeTypeString (C#)
Previous | Next |
IXMLDOMNode.nodeTypeString (C#)
The nodeTypeString property returns the node type in string form.
Syntax
string = IXMLDOMNode.nodeTypeString;
Remarks
The property is read-only. It contains the string version of the node type. To return the enumeration value, use the nodeType property.
The value of the string returned depends on the type of node on which the nodeTypeString property is called, as shown in the following table. For example, if the node type is NODE_ELEMENT, a string is returned containing the word "element".
Node type | Value returned |
NODE_ATTRIBUTE | Returns "attribute". |
NODE_COMMENT | Returns "comment". |
NODE_DOCUMENT | Returns "document". |
NODE_ELEMENT | Returns "element". |
NODE_PROCESSING_INSTRUCTION | Returns "processinginstruction". |
NODE_TEXT | Returns "text". |
Example Code
The following example creates an IXMLDOMNode object and displays its node type in string form, in this case, "element".
using Microsoft.WindowsMediaServices.Interop; using interop_msxml; // Declare variables. WMSServer Server; IXMLDOMDocument Playlist; IXMLDOMNode currNode; try { // Create a new WMSServer object. Server = new WMSServerClass(); // Create a new playlist object. 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 type as a string. currNode = Playlist.documentElement.childNodes[0]; MessageBox.Show(currNode.nodeTypeString); } catch (Exception e) { // TODO: Handle exceptions. }
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 |