What's the proper technique for checking for the existence of an attribute
within a node?
Lets say I did a SelectSingleNode which returned this element:
<AnAddress city="San Francisco" state="CA" />
What's the best why of determining if the attribute zipcode exists in this
node? If I try accessing the attribute with code like:
ZipCode = myNode.Attributes("zipcode").Value
I'll get an run-time error if the attribute doesn't exists. I know that I
can try accessing the attribute within a try-catch block and catch the
exception that way. Or, I could enumerate through all of the node's
attributes first to determine if that attribute exists.
Just wondering if there's a better solution? I didn't see any method like
"Exists"...