int GetAttributeIndex(string name, string ns) { if (attributes == null) { return(-1); } for (int i = 0; i < attributes.Count; i++) { if (AXmlObject.GetLocalName(attributes[i].Name) == name && (LookupNamespace(AXmlObject.GetNamespacePrefix(attributes[i].Name)) ?? string.Empty) == ns) { return(i); } } return(-1); }