IXMLDOMNode.previousSibling (Visual Basic .NET)
Previous | Next |
IXMLDOMNode.previousSibling (Visual Basic .NET)
The previousSibling property contains the previous sibling of this node in the parent's child list.
Syntax
IXMLDOMNode = IXMLDOMNode.previousSibling
Remarks
The property is read-only.
The value of the IXMLDOMNode object that is returned depends on the type of node on which the previousSibling property is called, as shown in the following table. For example, if the node type is NODE_ELEMENT, an IXMLDOMNode object is returned containing the node that immediately precedes that element node.
Node type | Value returned |
NODE_ATTRIBUTE NODE_DOCUMENT |
Always returns NULL; these node types do not appear as children of any other nodes. |
NODE_ELEMENT NODE_PROCESSING_INSTRUCTION, NODE_TEXT |
Returns the node immediately preceding this node in its parent's child list. Returns NULL if no such node exists. |
Example Code
The following example creates an IXMLDOMNode object and sets it to the previous sibling of the current node.
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 Dim prevNode As IXMLDOMNode ' Create a new playlist object. Set Playlist = Server.CreatePlaylist ' Load a playlist. Playlist.Load ("file://c:\wmpub\wmroot\simple.wsx") ' Retrieve the second child node of the root element. Set currNode = Playlist.documentElement.childNodes.Item(1) ' Retrieve the previous sibling. Set prevNode = currNode.previousSibling 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 |