GetNamedItem() vs. index

345 Views Asked by At

Is there a difference between method GetNamedItem("test") and access by index in XmlAttributeCollection? Maybe in null handling or in something else?

xml_node.Attributes.GetNamedItem("test").Value;
xml_node.Attributes["test"].Value;
1

There are 1 best solutions below

1
On BEST ANSWER

XmlAttributeCollection.ItemOf Property (String)

This property is a Microsoft extension to the Document Object Model (DOM). It is equivalent to calling GetNamedItem.