It looks like CaseTrackingID
has **
surrounding the tag. have you tried removing the double * from the XML file? I am not sure what the significance of the ** is but probably it is interfering with reading the file.
**<nc:CaseTrackingID>XXXXXXXXXX</nc:CaseTrackingID>**
That looks like a problem. Not sure if ** needs to be there are not.
Edit
How about changing the code like this instead. This will capture the text node while traversing the nodes
if (xr.NodeType == XmlNodeType.Element)
{
element = xr.Name;
}
else if (xr.NodeType == XmlNodeType.Text)
{
if (element == "nc:PersonFullName")
{
attyName = xr.Value;
}
else if (element == "nc:IdentificationID")
{
elementCount++;
DocID = xr.Value;
if (elementCount == 1)
{
reqID = DocID;
}
if (elementCount == 3)
{
empName = DocID;
}
if (elementCount == 8)
{
attyBarID = DocID;
elementCount = 0;
break;
}
}
else if (element == "nc:CaseTrackingID")
{
elementCount++;
DocID = xr.Value;
if (elementCount == 1)
{
reqID = DocID;
}
if (elementCount == 3)
{
empName = DocID;
}
if (elementCount == 8)
{
attyBarID = DocID;
elementCount = 0;
break;
}
}
}
Also put the elelment
variable outside the loop