Return to Snippet

Revision: 22237
at January 6, 2010 16:07 by Anthony


Initial Code
public string GetNodeText(XmlDocument xmlDoc, string nodeName)
{
    if (xmlDoc == null || string.IsNullOrEmpty(nodeName))
        return string.Empty;

    XmlNode node = xmlDoc.GetElementsByTagName(nodeName)[0];

    if (node == null)
        return string.Empty;

    return node.InnerText;
}

Initial URL


Initial Description


Initial Title
XML Node InnerText Wrapper Method

Initial Tags
xml

Initial Language
C#