GetChildNode() |
Top Previous Next |
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() If .IsChildNode(ndRoot,"MSH") Then MsgBox "There is a child node called MSH" Set ndList = .GetRootChildren() 'NOTE: ndRoot is just an MS XML Dom Node so this would also work: 'Set ndList = ndRoot.ChildNodes Set ndChild = .GetChildNode(ndList,"MSH") 'Show the XML for just the child node MsgBox "The MSH XML: " & ndChild.XML End If End With'Clean up the objects Set ndRoot = Nothing Set ndList = Nothing Set oXML = Nothing
End Sub
See Also: oUTILITIES.NewCommandoXMLObject() |