1

I am having trouble navigating to some nested XML nodes. I am using the XpathNavigator and can see the proper nodes have been captured, but I am not able to parse them properly. Any help would be appreciated:

<root>
  <audits>
<supervisorAuditId>311004</supervisorAuditId>
    <supervisorName>Munjkhkiz, John</supervisorName>
    <supervisorCenter>CA</supervisorCenter>
    <supervisorManager>HNubnot, Harry</supervisorManager>
    <followupDate>07/31/2014</followupDate>
    <graded>3</graded>
    <addedOn>07/23/2014</addedOn>
    <addedBy>HNubnot, Harry</addedBy>
    <responses>
      <mqField>BM1</mqField>
      <mqFieldTitle>Balanced Coaching</mqFieldTitle>
      <comments>another test</comments>
      <actions>another test 1</actions>
    </responses>
    <responses>
      <mqField>BM5</mqField>
      <mqFieldTitle>Productivity</mqFieldTitle>
      <comments>another test 4</comments>
      <actions>another test 5</actions>
    </responses>
    <responses>
      <mqField>BM3</mqField>
      <mqFieldTitle>Conduct</mqFieldTitle>
      <comments>another test 2</comments>
          <actions>another test 3</actions>
    </responses>
  </audits>
</root>

Code:

foreach (System.Xml.XPath.XPathNavigator item2 in iterator)
{
    System.Xml.XPath.XPathNavigator _element2 = item2.SelectSingleNode("audits/responses");

    _element2 = item2.SelectSingleNode("responses[@mqField='BM1']");
    comments1 = _element2.Value;

    _element2 = item2.SelectSingleNode("responses/actions");
    actions1 = _element2.Value;
}
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.