XPathNavigator in C#
Posted on 2006-11-17
I am using C#
I have instance of XPathNavigator
Now, what is required to me is that
Has the values or has the errors than it return no of nodes.
If errors node has no values, then it should return 0.
Has the values or it is 1
Can I have the Full XML file in String?
Can anyone check my code for this if it is correct?
especially saving of XPathNavigator to XML as string
I will save this string in database thereafter.
My Code is below:
public int isErrorExists(XPathNavigator nav)
XPathNodeIterator iterator = nav.Select("//errors");
int cnt = 0;
if (cnt!= 0)
string strXML = nav.InnerXml;
// Now save strXML in Database.
Guide me the best way and if my way is correct or not.
Also please correct my code if it is not.
Thanks in Advance