rwallacej
asked on
VB.net - XML node, check attribute exists
How do I check if an attribute exists in xml node
This, as expected, throws a null pointer.....but checking if the attribute exists in first place is surely better than catching exceptions?
Dim node As XmlNode = whatever
....
Dim x as String
x = node.Attributes.GetNamedIt em("fieldD oesntExist ").Value
Thanks
This, as expected, throws a null pointer.....but checking if the attribute exists in first place is surely better than catching exceptions?
Dim node As XmlNode = whatever
....
Dim x as String
x = node.Attributes.GetNamedIt
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dimandja
this is what I'm looking for rather than a for loop, but its a node I've got, not an element......
this is what I'm looking for rather than a for loop, but its a node I've got, not an element......
ASKER
the node is from an XmlNodeList
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
result = element.hasAttribute(attNa