I'm trying to move to another attribute in an xml element but am not having much luck doing this.
Xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<finances>
<financial no="0" id="431" rowID="0" ddlValue="Return" ddlNote="Post Dated" ddBranch="" ddType="" />
</finances>
Code :
Dim child = 0
child = childRow.RowIndex
Dim hidden = CType(gvChild.DataKeys(child)("id"), Integer)
For Each node As XmlNode In doc.SelectNodes("//financial/@id")
If node.Value = hidden.ToString Then
If Not doc.SelectSingleNode("//financial/@ddlNote").InnerText.Equals("") Then
LblErr.Text = doc.SelectSingleNode("//financial/@ddlNote").InnerText
End If
End If
Next
Basically, when the id equals what's on my form I want it to move to the ddlNote attribute and display the value from it. It triggers the first if statement, when it matches up with the id that's on the form it moves to the inner if statement, but the inner if statement won't trigger. How would I move to that attribute (seeing as I'm starting at the id attribute, how would I move to ddlNote)?