protected virtual void Load (XmlDocument objects) { classes_by_cname.Clear (); classes_by_csname.Clear (); enums.Clear (); if (objects == null || objects.DocumentElement == null) return; targetGtkVersion = objects.DocumentElement.GetAttribute ("gtk-version"); if (targetGtkVersion.Length == 0) targetGtkVersion = "2.4"; foreach (XmlElement element in objects.SelectNodes ("/objects/enum")) { EnumDescriptor enm = new EnumDescriptor (element); enums[enm.Name] = enm; } foreach (XmlElement element in objects.SelectNodes ("/objects/object")) AddClass (LoadClassDescriptor (element)); XmlNamespaceManager nsm = new XmlNamespaceManager (objects.NameTable); nsm.AddNamespace ("xsl", "http://www.w3.org/1999/XSL/Transform"); XmlNodeList nodes = objects.SelectNodes ("/objects/object/glade-transform/import/xsl:*", nsm); importElems = new XmlElement [nodes.Count]; for (int n=0; n<nodes.Count; n++) importElems [n] = (XmlElement) nodes[n]; nodes = objects.SelectNodes ("/objects/object/glade-transform/export/xsl:*", nsm); exportElems = new XmlElement [nodes.Count]; for (int n=0; n<nodes.Count; n++) exportElems [n] = (XmlElement) nodes[n]; }