How do I get the value for "ID" from this XML?
<T3 Version="5" DateCreated="2003/04/30">
<Layer ID="AB">
<LOB>xxxx</LOB>
<PolicyIndicator ID="Standard" Effective="2003/05/11">
</PolicyIndicator>
<PolicyIndicator ID="Nonstandard" Effective="2003/07/01">
</PolicyIndicator>
</Layer>
<Layer ID="CD">
<LOB>xxxxx</LOB>
<PolicyIndicator ID="Standard" Effective="2003/05/11">
</PolicyIndicator>
<PolicyIndicator ID="Nonstandard" Effective="2003/07/01">
</PolicyIndicator>
</Layer>
</T3>
My code so far is like this. I had this working but lost the codes and for some reason I am having a hard time gettthing this working...very frustrating. ??? is the area I am having trouble with. Please, be my other set of eyes....very much appreciated.
Dim lndTopNode As Msxml2.IXMLDOMNode
Dim lndChildNode As Msxml2.IXMLDOMNode
Dim lndGrandChildNode As Msxml2.IXMLDOMNode
-- and some more Dim stmt for variables used here...
Set lndTopNode = xmlDoc.selectSingleNode("T3"
For Each lndChildNode In lndTopNode.childNodes
If lndChildNode.Attributes.Item(0).Text = lcStateSearch Then
For Each lndGrandChildNode In lndChildNode.childNodes
If lndGrandChildNode.baseName = "LOB" Then
lcLOB = lndGrandChildNode.Text
Else
If lndGrandChildNode.Attributes.length <> 0 Then
If lndGrandChildNode.Attributes.getNamedItem("ID"
= "Standard" Then
' Do something But it's blowing up on this line....???
End If
End If
End If
Next
End If
Next
<T3 Version="5" DateCreated="2003/04/30">
<Layer ID="AB">
<LOB>xxxx</LOB>
<PolicyIndicator ID="Standard" Effective="2003/05/11">
</PolicyIndicator>
<PolicyIndicator ID="Nonstandard" Effective="2003/07/01">
</PolicyIndicator>
</Layer>
<Layer ID="CD">
<LOB>xxxxx</LOB>
<PolicyIndicator ID="Standard" Effective="2003/05/11">
</PolicyIndicator>
<PolicyIndicator ID="Nonstandard" Effective="2003/07/01">
</PolicyIndicator>
</Layer>
</T3>
My code so far is like this. I had this working but lost the codes and for some reason I am having a hard time gettthing this working...very frustrating. ??? is the area I am having trouble with. Please, be my other set of eyes....very much appreciated.
Dim lndTopNode As Msxml2.IXMLDOMNode
Dim lndChildNode As Msxml2.IXMLDOMNode
Dim lndGrandChildNode As Msxml2.IXMLDOMNode
-- and some more Dim stmt for variables used here...
Set lndTopNode = xmlDoc.selectSingleNode("T3"
For Each lndChildNode In lndTopNode.childNodes
If lndChildNode.Attributes.Item(0).Text = lcStateSearch Then
For Each lndGrandChildNode In lndChildNode.childNodes
If lndGrandChildNode.baseName = "LOB" Then
lcLOB = lndGrandChildNode.Text
Else
If lndGrandChildNode.Attributes.length <> 0 Then
If lndGrandChildNode.Attributes.getNamedItem("ID"
' Do something But it's blowing up on this line....???
End If
End If
End If
Next
End If
Next