GetNodeChildren()

Top  Previous  Next

Method

GetNodeChildren(oNode)

Parameters

oNode (object, MSXML DOM Node)

Returns

(object An MS XML DOM NodeList) or Nothing on failure.

Example

See Below.

 

 

Example VBScript Code

 

Private Sub DemoXML()

 

Dim oXML, ndRoot, ndList

Dim sBuff, i

 

'Create the object

Set oXML = oUTILITIES.NewCommandoXMLObject()

 

'Using the With / End With statements make for easy shortcuts

With oXML

   'Open an XML File

   If Not .OpenFromFile(oUTILITIES.ApplicationPath & "MyFileName.XML") Then

     SMEvent.Raise "ERROR", "XML File Open Failed"

   End If

    Set ndRoot = .GetRootElement()   

      'Calling GetNodeChildren() on the root element is the same as calling

      'GetRootChildren().

     Set ndList = .GetNodeChildren(ndRoot)

     'NOTE: ndRoot is just an MS XML Dom Node so this would also work:

     'Set ndList = ndRoot.ChildNodes

   If Not (ndList Is NothingThen   

     MsgBox "The root element has " & ndList.Length & " Child Nodes"

   Else 

     MsgBox "The root element has no Child Nodes"

   End If       'Show the XML

   MsgBox .XML, vbInformation, "The CommandoXML Object"

End With

'Clean up the objects

Set ndRoot = Nothing

Set ndList = Nothing

Set oXML = Nothing

 

End Sub

 

See Also: oUTILITIES.NewCommandoXMLObject()