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 [url removed, login to view] - 1
If [url removed, login to view](i).nodeType = NODE_TEXT Then
s = s + [url removed, login to view](i).nodeValue
ElseIf [url removed, login to view](i).nodeType = NODE_ELEMENT & [url removed, login to view](i).tagName = "BR" Then
s = s + vbNullString
s = s + getText([url removed, login to view](i))
getText = s
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.
1) Code snippet I should be able to integrate into my own program.