I am trying to put in a variable from xmlnode.element ( facsimile) value '777777'
<hospital>
<specialist1>
<id>815175007</id>
<medic>
<facsimile>777777</facsimile>
<first_name>Bob</first_name>
<last_name>Smith</last_name>
</medic>
</specialist1>
</hospital>
I am using this code:
Set xmlNodeList = resp.getElementsByTagName("*")
For Each xmlNode In xmlNodeList
If xmlNode.nodeName = "specialist1" Then
Dim spec1 As String
If xmlNode.HasChildNodes = True Then
If xmlNode.ChildNodes.item(1).nodeName = "medic" Then
If xmlNode.HasChildNodes = True Then
spec1 = xmlNode.ChildNodes.item(0).text
End If
End If
End If
Next
but it doesn't work
Please help
<hospital>
<specialist1>
<id>815175007</id>
<medic>
<facsimile>777777</facsimile>
<first_name>Bob</first_name>
<last_name>Smith</last_name>
</medic>
</specialist1>
</hospital>
I am using this code:
Set xmlNodeList = resp.getElementsByTagName("*")
For Each xmlNode In xmlNodeList
If xmlNode.nodeName = "specialist1" Then
Dim spec1 As String
If xmlNode.HasChildNodes = True Then
If xmlNode.ChildNodes.item(1).nodeName = "medic" Then
If xmlNode.HasChildNodes = True Then
spec1 = xmlNode.ChildNodes.item(0).text
End If
End If
End If
Next
but it doesn't work
Please help