NAnt.Core.FrameworkInfo.GetXmlAttributeValue C# (CSharp) Method

GetXmlAttributeValue() private static method

Gets the value of the specified attribute from the specified node.
private static GetXmlAttributeValue ( XmlNode xmlNode, string attributeName ) : string
xmlNode XmlNode The node of which the attribute value should be retrieved.
attributeName string The attribute of which the value should be returned.
return string
        private static string GetXmlAttributeValue(XmlNode xmlNode, string attributeName)
        {
            string attributeValue = null;

            if (xmlNode != null) {
                XmlAttribute xmlAttribute = (XmlAttribute)xmlNode.Attributes.GetNamedItem(attributeName);

                if (xmlAttribute != null) {
                    attributeValue = StringUtils.ConvertEmptyToNull(xmlAttribute.Value);
                }
            }

            return attributeValue;
        }