1 // Author: Dwivedi, Ajay kumar
\r
6 namespace System.Xml.Schema
\r
9 /// Summary description for XmlSchemaMinInclusiveFacet.
\r
11 public class XmlSchemaMinInclusiveFacet : XmlSchemaFacet
\r
13 const string xmlname = "minInclusive";
\r
15 public XmlSchemaMinInclusiveFacet()
\r
19 internal override Facet ThisFacet {
\r
20 get { return Facet.minInclusive ;}
\r
24 // fixed = boolean : false
\r
26 // value = anySimpleType
\r
27 // {any attributes with non-schema namespace . . .}>
\r
28 // Content: (annotation?)
\r
30 internal static XmlSchemaMinInclusiveFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
\r
32 XmlSchemaMinInclusiveFacet mini = new XmlSchemaMinInclusiveFacet();
\r
33 reader.MoveToElement();
\r
35 if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
\r
37 error(h,"Should not happen :1: XmlSchemaMinInclusiveFacet.Read, name="+reader.Name,null);
\r
42 mini.LineNumber = reader.LineNumber;
\r
43 mini.LinePosition = reader.LinePosition;
\r
44 mini.SourceUri = reader.BaseURI;
\r
46 while(reader.MoveToNextAttribute())
\r
48 if(reader.Name == "id")
\r
50 mini.Id = reader.Value;
\r
52 else if(reader.Name == "fixed")
\r
55 mini.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
\r
57 error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
\r
59 else if(reader.Name == "value")
\r
61 mini.Value = reader.Value;
\r
63 else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
\r
65 error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
\r
69 XmlSchemaUtil.ReadUnhandledAttribute(reader,mini);
\r
73 reader.MoveToElement();
\r
74 if(reader.IsEmptyElement)
\r
77 // Content: (annotation?)
\r
79 while(reader.ReadNextElement())
\r
81 if(reader.NodeType == XmlNodeType.EndElement)
\r
83 if(reader.LocalName != xmlname)
\r
84 error(h,"Should not happen :2: XmlSchemaMinInclusiveFacet.Read, name="+reader.Name,null);
\r
87 if(level <= 1 && reader.LocalName == "annotation")
\r
89 level = 2; //Only one annotation
\r
90 XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
\r
91 if(annotation != null)
\r
92 mini.Annotation = annotation;
\r
95 reader.RaiseInvalidElementError();
\r