HI i am facing an situation where i need to iterate over an xml to find the required data my xml structure is as follows and i am using following xpath query to find node children where area = some value. But this structure repeats several times in xml where some dont have node, i mean node is missing. so when i try to use Xpath for iterating over xml it is giving error checkin text missing. How can i handle this error.please help me
XPathDocument document = new XPathDocument(gFilepathName);
XPathNavigator navigator = document.CreateNavigator();
XPathNodeIterator nodes = navigator.Select("ReleaseNotes/ChangeSet/Comments/checkintext/task[area='"+functionalArea+"']");
<ChangeSet>
<CheckinID>3375</CheckinID>
<CheckinBy>INNOVITES\nagaprasad.k</CheckinBy>
<Comments>
<checkintext>
<bpcheckdeviated>true</bpcheckdeviated>
<task>
<id>CS-2024</id>
<name>Selected dimensions not shown in production sequencing form.</name>
<version>V6.0</version>
<sprint>84</sprint>
<project>Cs2024_Prd_CorrectDimensionDisplay</project>
<area>40. Production</area>
<taskstatus>Closed</taskstatus>
</task>
<text>
1. Components check-in for correct dimensions display based on set-up.
2. Previously InventDimensions group was removed, now we restored previous version and set visibility no. InventoryDimensions group is kept as it was.
</text>
<notes />
</checkintext>
</Comments>
<Changes>
<Component>
<Name>CsPsqProdSequence.xpo</Name>
<Type>Forms</Type>
<Action>Edit</Action>
</Component>
</Changes>
</ChangeSet>
No comments:
Post a Comment