1 // Author: Dwivedi, Ajay kumar
\r
5 using System.Xml.Serialization;
\r
7 namespace System.Xml.Schema
\r
10 /// Summary description for XmlSchemaAppInfo.
\r
12 public class XmlSchemaAppInfo : XmlSchemaObject
\r
14 private XmlNode[] markup;
\r
15 private string source;
\r
17 public XmlSchemaAppInfo()
\r
21 [System.Xml.Serialization.XmlAttribute("source")]
\r
22 public string Source
\r
24 get{ return source; }
\r
25 set{ source = value; }
\r
30 public XmlNode[] Markup
\r
32 get{ return markup; }
\r
33 set{ markup = value; }
\r
38 // Content: ({any})*
\r
40 internal static XmlSchemaAppInfo Read(XmlSchemaReader reader, ValidationEventHandler h, out bool skip)
\r
43 XmlSchemaAppInfo appinfo = new XmlSchemaAppInfo();
\r
44 reader.MoveToElement();
\r
46 if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != "appinfo")
\r
48 error(h,"Should not happen :1: XmlSchemaAppInfo.Read, name="+reader.Name,null);
\r
53 appinfo.LineNumber = reader.LineNumber;
\r
54 appinfo.LinePosition = reader.LinePosition;
\r
55 appinfo.SourceUri = reader.BaseURI;
\r
57 while(reader.MoveToNextAttribute())
\r
59 if(reader.Name == "source")
\r
61 appinfo.source = reader.Value;
\r
65 error(h,reader.Name + " is not a valid attribute for appinfo",null);
\r
69 reader.MoveToElement();
\r
70 if(reader.IsEmptyElement)
\r
74 //FIXME: This is a pure Quick Hack; There must be a another method;
\r
75 XmlDocument xmldoc = new XmlDocument();
\r
76 xmldoc.AppendChild(xmldoc.ReadNode(reader));
\r
77 XmlNode root = xmldoc.FirstChild;
\r
78 if(root != null && root.ChildNodes != null)
\r
80 appinfo.Markup = new XmlNode[root.ChildNodes.Count];
\r
81 for(int i=0;i<root.ChildNodes.Count;i++)
\r
83 appinfo.Markup[i] = root.ChildNodes[i];
\r
86 if(reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.EndElement)
\r