IXMLDOMNode.cloneNode (Visual Basic .NET)
Previous | Next |
IXMLDOMNode.cloneNode (Visual Basic .NET)
The cloneNode method creates a new node that is an exact clone of this node.
Syntax
IXMLDOMNode = IXMLDOMNode .cloneNode( bdeep As Boolean )
Parameters
bdeep
[in] Boolean flag that indicates whether to recursively clone all nodes that are descendants of this node. If True, the complete tree below this node is cloned. If False, only this node and its attributes is cloned.
Return Values
Returns the newly created clone node.
Remarks
The cloned node has the same property values as this node for the following properties: nodeName, nodeValue, nodeType, parentNode, ownerDocument, and, if it is an element, the attributes property. The value of the clone's childNodes property depends on the setting of the flag parameter.
Example Code
The following example clones a node, and then appends the clone as a child of the top-level node.
Imports interop_msxml Imports Microsoft.WindowsMediaServices.Interop On Error GoTo Err ' Declare variables. Dim Server As New WMSServerClass() Dim Playlist As IXMLDOMDocument Dim root As IXMLDOMElement Dim currNode As IXMLDOMNode Dim MyNewNode As IXMLDOMNode ' Create a new playlist object. Set Playlist = Server.CreatePlaylist ' Load a playlist. Playlist.Load ("file://c:\wmpub\wmroot\simple.wsx") ' Retrieve the root element. Set root = Playlist.documentElement ' Retrieve a child node and clone it. Set currNode = root.childNodes.Item(1) Set MyNewNode = currNode.cloneNode(True) ' Append the node as a child node of the root ' element. root.appendChild MyNewNode 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 |