diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2003-09-30 23:17:56 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2003-09-30 23:17:56 +0400 |
commit | c62c061680dfd54439ca42d5160d580807fa69e6 (patch) | |
tree | e646a20d64b193824293f65dd1be8fc53a524985 /mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs | |
parent | e4f42dc349479c84e9b88bc8e4dc027045e17f12 (diff) |
2003-09-30 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* Forgot to append 8/24/2003 ChangeLog.
* BUGS.txt, BUGS-MS.txt : Appended additional bug info.
* BuiltInDatatype.cs, ValidationHandler.cs, XmlSchema.cs,
XmlSchemaAll.cs, XmlSchemaAnnotation.cs. XmlSchemaAny.cs,
XmlSchemaAnyAttribute.cs, XmlSchemaAttribute.cs,
XmlSchemaAttributeGroup.cs, XmlSchemaAttributeGroupRef.cs,
XmlSchemaChoice.cs, XmlSchemaCollection.cs,
XmlSchemaComplexContent.cs, XmlSchemaComplexContentExtension.cs,
XmlSchemaComplexContentRestriction.cs, XmlSchemaComplexType.cs,
XmlSchemaContent.cs, XmlSchemaDatatype.cs, XmlSchemaElement.cs,
XmlSchemaException.cs, XmlSchemaGroup.cs, XmlSchemaGroupBase.cs,
XmlSchemaGroupRef.cs, XmlSchemaIdentityConstraint.cs,
XmlSchemaKey.cs, XmlSchemaKeyref.cs, XmlSchemaNotation.cs,
XmlSchemaObject.cs, XmlSchemaObjectTable.cs, XmlSchemaParticle.cs,
XmlSchemaReader.cs, XmlSchemaSequence.cs, XmlSchemaSimpleContent.cs,
XmlSchemaSimpleContentExtension.cs,
XmlSchemaSimpleContentRestriction.cs, XmlSchemaSimpleType.cs,
XmlSchemaSimpleTypeContent.cs, XmlSchemaSimpleTypeList.cs,
XmlSchemaSimpleTypeRestriction.cs, XmlSchemaSimpleTypeUnion.cs,
XmlSchemaType.cs, XmlSchemaUnique.cs, XmlSchemaUtil.cs,
XmlSchemaXPath.cs :
- Almost all classes are changed to implement schema component
constraints, and schema validation using XsdValidatingReader.
- better exception messages.
- More datatype support.
and so on.
svn path=/trunk/mcs/; revision=18444
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs')
-rwxr-xr-x | mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs index b7b88ff2443..f77dbb789e4 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs @@ -75,15 +75,24 @@ namespace System.Xml.Schema /// 1. Base must be present and a QName
///</remarks>
[MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchema schema)
+ internal override int Compile(ValidationEventHandler h, XmlSchema schema)
{
// If this is already compiled this time, simply skip.
if (this.IsComplied (schema.CompilationId))
return 0;
+ if (this.isRedefinedComponent) {
+ if (Annotation != null)
+ Annotation.isRedefinedComponent = true;
+ if (AnyAttribute != null)
+ AnyAttribute.isRedefinedComponent = true;
+ foreach (XmlSchemaObject obj in Attributes)
+ obj.isRedefinedComponent = true;
+ }
+
if(BaseTypeName == null || BaseTypeName.IsEmpty)
{
- error(h, "base must be present and a QName");
+ error(h, "base must be present, as a QName");
}
else if(!XmlSchemaUtil.CheckQName(BaseTypeName))
error(h,"BaseTypeName must be a QName");
@@ -123,8 +132,33 @@ namespace System.Xml.Schema }
[MonoTODO]
- internal int Validate(ValidationEventHandler h)
+ internal override int Validate(ValidationEventHandler h, XmlSchema schema)
{
+ if (IsValidated (schema.ValidationId))
+ return errorCount;
+
+ if (baseType != null) {
+ baseType.Validate (h, schema);
+ actualBaseSchemaType = baseType;
+ }
+ else if (baseTypeName != XmlQualifiedName.Empty) {
+ XmlSchemaType st = schema.SchemaTypes [baseTypeName] as XmlSchemaType;
+ if (st != null) {
+ st.Validate (h, schema);
+ actualBaseSchemaType = st;
+ } else if (baseTypeName == XmlSchemaComplexType.AnyTypeName) {
+ actualBaseSchemaType = XmlSchemaComplexType.AnyType; + } else if (baseTypeName.Namespace == XmlSchema.Namespace) {
+ actualBaseSchemaType = XmlSchemaDatatype.FromName (baseTypeName);
+ if (actualBaseSchemaType == null)
+ error (h, "Invalid schema datatype name is specified.");
+ }
+ // otherwise, it might be missing sub components.
+ else if (!schema.missedSubComponents)// && schema.Schemas [baseTypeName.Namespace] != null)
+ error (h, "Referenced base schema type " + baseTypeName + " was not found in the corresponding schema.");
+ }
+
+ ValidationId = schema.ValidationId;
return errorCount;
}
|