I'm relatively new to XML and was having a problem. What I need is to extract nested element text from specific elements. For example, I want to extract all text in a "FONT" tag. But, if there are embedded tags between the opening and closing "FONT" tags, the XML extraction stops before the first embedded tag.
Here is an example of some code I'm using to exract the text in childNodes and append it to the string.
Public Function getText(el) As String
Dim i As Long
Dim s As String
For i = 0 To [login to view URL] - 1
If [login to view URL](i).nodeType = NODE_TEXT Then
s = s + [login to view URL](i).nodeValue
ElseIf [login to view URL](i).nodeType = NODE_ELEMENT & [login to view URL](i).tagName = "BR" Then
s = s + vbNullString
Else
s = s + getText([login to view URL](i))
End If
Next i
getText = s
End Function
I'm using the webbrowser control to get the HTML page.
I'm sure the answer is simple, hence the low max price. I'm just looking for a line of two of code or an explanation so I can do it myself.
## Deliverables
1) Code snippet I should be able to integrate into my own program.
## Platform
IE 5.0+