//Microsoft Public License (Ms-PL)
//http://dbmlmanager.codeplex.com/license
#region using
using System;
using System.Xml;
#endregion
namespace DbmlManager.Lib.Utility
{
#region Class Docs
///
/// Summary description for XmlUtil.
///
#endregion
public class XmlUtil
{
#region GetIntAttrib(XmlNode node, string attrib, int defVal)
public static int GetIntAttrib(XmlNode node, string attrib, int defVal)
{
XmlAttribute xmlAttrib = node.Attributes[attrib];
if (xmlAttrib == null)
return defVal;
string val = xmlAttrib.Value;
if (val == null || val == string.Empty)
return defVal;
int returnVal = defVal;
int.TryParse(val, out returnVal);
return returnVal;
}
#endregion
}
}