According to the MSDN:
The concatenated values of the node and all its children. For attribute nodes, this property has the same functionality as the Value property.
You should just use the Value
property, instead, like this:
node.Attributes("ID").Value
Or you can cast it to an XmlNode
and then access the InnerText
. XmlNode
is the base class for XmlAttribute
, and its InnerText
property is read-write rather than write-only. For instance:
CType(node.Attributes("ID"), XmlNode).InnerText
I'm not sure why it's write-only in the XmlAttribute
class. Presumably there must have been some good reason for it, given the internal workings of the class, though it's hard to imagine what that would be. The odd thing is that in the MSDN documentation in version 1.1 actually says that it is a read/write property in that version of the framework. Then, in versions 2.0 - 4.0 it defines the property as write-only, but the description of it says "Gets or sets..." So, the MSDN hasn't exactly been consistent about it.