string myAttribute = String.Empty;
if (configNode.Attributes["someAttribute"] != null)
{
myAttribute = configNode.Attributes["someAttribute"].Value;
}
or to be safer you could use:
if (configNode.Attributes["someAttribute"] != null &&
!String.IsNullOrEmpty(configNode.Attributes["someAttribute
against missing xml
nodes/attributes
string myAttribute = null;
XmlAttribute someAttribute = configNode.Attributes["someAttribute"];
if (someAttribute != null)
myAttribute = someAttribute.Value;
Hope this helps,
//p
On Fri, Jun 6, 2008 at 9:19 PM, Smotrisky, Alex
<[EMAIL PROT
string myAttribute = null;
XmlAttribute someAttribute = configNode.Attributes["someAttribute"];
if (someAttribute != null)
myAttribute = someAttribute.Value;
Hope this helps,
//p
On Fri, Jun 6, 2008 at 9:19 PM, Smotrisky, Alex
<[EMAIL PROTECTED]> wrote:
> I've got an object called configNode