HasChildren() |
Top Previous Next |
Object: EHL7.QSXML FileName: EHL7.dll
METHOD
Name: HasChildren() Parameters:
Returns: Boolean Description: This method returns True if objNode has childnodes and False if not.
*XML Note: The native XML function will also work so objNode.hasChildNodes is the functional equivalent of this method.
Example: Dim myXMLObj As New EHL7.QSXML Dim strXML As String Dim ndRT As Object Dim ndChildren As Object Dim i As Long With myXmlObj .ClearErrors strXML = "<GOODXML></GOODXML>" Call .OpenFromString(strXML) If .IsError Then MsgBox .LastError .ClearErrors Exit Sub End If 'Add 3 child nodes strXML = "<CHILD></CHILD>" Set ndRT = .GetRootElement() Call .XMLAddNode ndRT,strXML Call .XMLAddNode ndRT,strXML Call .XMLAddNode ndRT,strXML If Not .HasChildren(ndRT) Then MsgBox "Something is wrong, the root node should have 3 children" Exit Sub End If Set ndChildren = .GetRootChildren() 'Is the same as calling Set ndChildren = .GetNodeChildren(ndRT) End With Set myXMLObj = Nothing
|