Index: class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs =================================================================== RCS file: /mono/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs,v retrieving revision 1.7 diff -u -r1.7 XmlSchemaAnnotation.cs --- class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs 18 Jun 2002 10:47:40 -0000 1.7 +++ class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs 14 Jan 2003 12:42:08 -0000 @@ -110,6 +110,7 @@ //Content: (appinfo | documentation)* bool skip = false; + string expectedEnd = null; while(!reader.EOF) { if(skip) @@ -119,15 +120,27 @@ if(reader.NodeType == XmlNodeType.EndElement) { - if(reader.LocalName != xmlname) - error(h,"Should not happen :2: XmlSchemaAnnotation.Read, name="+reader.Name,null); - break; + bool end = true; + string expected = xmlname; + if(expectedEnd != null) + { + expected = expectedEnd; + expectedEnd = null; + end = false; + } + if(reader.LocalName != expected) + error(h,"Should not happen :2: XmlSchemaAnnotation.Read, name="+reader.Name+",expected="+expected,null); + if (end) + break; + else + continue; } if(reader.LocalName == "appinfo") { XmlSchemaAppInfo appinfo = XmlSchemaAppInfo.Read(reader,h,out skip); if(appinfo != null) annotation.items.Add(appinfo); + expectedEnd = "appinfo"; continue; } if(reader.LocalName == "documentation") @@ -135,6 +148,7 @@ XmlSchemaDocumentation documentation = XmlSchemaDocumentation.Read(reader,h, out skip); if(documentation != null) annotation.items.Add(documentation); + expectedEnd = "documentation"; continue; } reader.RaiseInvalidElementError(); Index: class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs =================================================================== RCS file: /mono/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs,v retrieving revision 1.5 diff -u -r1.5 XmlSchemaAppInfo.cs --- class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs 18 Jun 2002 10:47:40 -0000 1.5 +++ class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs 14 Jan 2003 12:42:08 -0000 @@ -73,14 +73,36 @@ //Content {any}* //FIXME: This is a pure Quick Hack; There must be a another method; XmlDocument xmldoc = new XmlDocument(); - xmldoc.AppendChild(xmldoc.ReadNode(reader)); - XmlNode root = xmldoc.FirstChild; - if(root != null && root.ChildNodes != null) + while(reader.NodeType != XmlNodeType.EndElement || reader.LocalName != "appinfo") { - appinfo.Markup = new XmlNode[root.ChildNodes.Count]; - for(int i=0;i