Reformat changes, and add some small debugging information to catch errors
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaAppInfo.cs
index 0f58e3d84371675bc36d81f0aa0352bd018fb687..da66837c504c8de8c0644496050d86101fb71906 100755 (executable)
@@ -18,6 +18,13 @@ namespace System.Xml.Schema
                {\r
                }\r
 \r
+               [System.Xml.Serialization.XmlAttribute("source")]\r
+               public string Source \r
+               {\r
+                       get{ return  source; } \r
+                       set{ source = value; }\r
+               }\r
+\r
                [XmlAnyElement]\r
                [XmlText]\r
                public XmlNode[] Markup \r
@@ -26,19 +33,13 @@ namespace System.Xml.Schema
                        set{ markup = value; }\r
                }\r
 \r
-               [System.Xml.Serialization.XmlAttribute("source")]\r
-               public string Source \r
-               {\r
-                       get{ return  source; } \r
-                       set{ source = value; }\r
-               }\r
-\r
                //<appinfo\r
                //  source = anyURI>\r
                //  Content: ({any})*\r
                //</appinfo>\r
-               internal static XmlSchemaAppInfo Read(XmlSchemaReader reader, ValidationEventHandler h)\r
+               internal static XmlSchemaAppInfo Read(XmlSchemaReader reader, ValidationEventHandler h, out bool skip)\r
                {\r
+                       skip = false;\r
                        XmlSchemaAppInfo appinfo = new XmlSchemaAppInfo();\r
                        reader.MoveToElement();\r
 \r
@@ -70,13 +71,20 @@ namespace System.Xml.Schema
                                return appinfo;\r
 \r
                        //Content {any}*\r
-                       //FIXME: How to handle {any}* content\r
-                       while(reader.Read())\r
+                       //FIXME: This is a pure Quick Hack; There must be a another method;\r
+                       XmlDocument xmldoc = new XmlDocument();\r
+                       xmldoc.AppendChild(xmldoc.ReadNode(reader));\r
+                       XmlNode root = xmldoc.FirstChild;\r
+                       if(root != null && root.ChildNodes != null)\r
                        {\r
-                               if(reader.NodeType == XmlNodeType.EndElement && reader.NamespaceURI == XmlSchema.Namespace && \r
-                                       reader.LocalName == "appinfo")\r
-                                       break;\r
+                               appinfo.Markup = new XmlNode[root.ChildNodes.Count];\r
+                               for(int i=0;i<root.ChildNodes.Count;i++)\r
+                               {\r
+                                       appinfo.Markup[i] = root.ChildNodes[i];\r
+                               }\r
                        }\r
+                       if(reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.EndElement)\r
+                               skip = true;\r
                        return appinfo;\r
                }\r
        }\r