Why is it that the following NodeList gets 'created' properly, but doesn't have the single node I'd expect (i.e. why is NodeList.length = 0 and not = 1)
VB Code:
Private Sub Form_Load() Dim oDOM As New DOMDocument40 Dim oDOMFrag As IXMLDOMDocumentFragment Dim oNodeList As IXMLDOMNodeList Dim oNode As IXMLDOMNode Dim oDocEl As IXMLDOMElement Dim oElem As IXMLDOMElement Dim oSel As IXMLDOMSelection Dim bRet As Boolean Dim lLen As Long oDOM.async = True bRet = oDOM.loadXML("<LogicalPair True=""Active"" False=""Inactive"">Active :: Inactive</LogicalPair>") If (bRet) Then Set oDocEl = oDOM.documentElement Set oNodeList = oDocEl.getElementsByTagName("LogicalPair") lLen = oNodeList.length Set oNode = oNodeList.Item(0) End If End Sub





Reply With Quote