[Mono-list] System.Xml.XmlAttributeCollection.ItemOf Inaccessible

Adam Tauno Williams awilliam@whitemice.org
Wed, 01 Sep 2004 05:42:22 -0400


> Is this supposed to be true....
> 'System.Xml.XmlAttributeCollection.ItemOf' is inaccessible due 
> to its protection level(CS0122)
> ...with code like -
> private static void ParseModules(XmlNodeList xmlNodeList)
> {
>  int moduleNumber = 0;
>  foreach(XmlNode xmlNode in xmlNodeList)
>  {
>   Console.WriteLine("Processing Module: " + moduleNumber);
>   Console.WriteLine("  Assembly Name: " +
>     xmlNode.Attributes.ItemOf("Assembly").Value);
>  ...
>   moduleNumber++;
>  }

This works -
XmlElement xmlElement = (XmlElement)xmlNode;
assemblyFile = xmlElement.GetAttribute("Assembly");
assemblyClass = xmlElement.GetAttribute("Class");
Console.WriteLine("  *Assembly Name: " + assemblyFile);
Console.WriteLine("  *Assembly Class: " + assemblyClass);
- just seems a little convoluted.