Created
December 8, 2009 15:36
-
-
Save sween/251732 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetNodeValue2(XPathDocument sdoc, string sSelectExpression) | |
{ | |
string sRetVal = ""; | |
// Read the XML document | |
//XPathDocument myXPathDocument = new XPathDocument(sFileName); | |
XPathNavigator myXPathNavigator = sdoc.CreateNavigator(); | |
XPathNodeIterator myXPathNodeIterator = myXPathNavigator.Select(sSelectExpression); | |
while (myXPathNodeIterator.MoveNext()) | |
{ | |
//Console.WriteLine("<" + myXPathNodeIterator.Current.Name + "> " + myXPathNodeIterator.Current.Value); | |
sRetVal = myXPathNodeIterator.Current.Value; | |
} | |
return sRetVal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment