set{ form = value; }\r
}\r
\r
- [DefaultValue(null)]\r
+ [DefaultValue("")]\r
[System.Xml.Serialization.XmlAttribute("name")]\r
public string Name \r
{\r
\r
#region Elements\r
\r
- [XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]\r
- [XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]\r
+ [XmlElement("simpleType",typeof(XmlSchemaSimpleType))]\r
+ [XmlElement("complexType",typeof(XmlSchemaComplexType))]\r
public XmlSchemaType SchemaType \r
{\r
get{ return schemaType; }\r
set{ schemaType = value; }\r
}\r
\r
- [XmlElement("unique",typeof(XmlSchemaUnique),Namespace="http://www.w3.org/2001/XMLSchema")]\r
- [XmlElement("key",typeof(XmlSchemaKey),Namespace="http://www.w3.org/2001/XMLSchema")]\r
- [XmlElement("keyref",typeof(XmlSchemaKeyref),Namespace="http://www.w3.org/2001/XMLSchema")]\r
+ [XmlElement("unique",typeof(XmlSchemaUnique))]\r
+ [XmlElement("key",typeof(XmlSchemaKey))]\r
+ [XmlElement("keyref",typeof(XmlSchemaKeyref))]\r
public XmlSchemaObjectCollection Constraints \r
{\r
get{ return constraints; }\r
internal override int Compile(ValidationEventHandler h, XmlSchema schema)\r
{\r
// If this is already compiled this time, simply skip.\r
- if (this.IsComplied (schema.CompilationId))\r
+ if (CompilationId == schema.CompilationId)\r
return 0;\r
InitPostCompileInformations ();\r
this.schema = schema;\r
if (schemaType != null)\r
elementType = schemaType;\r
else if (SchemaTypeName != XmlQualifiedName.Empty) {\r
- XmlSchemaType type = schema.SchemaTypes [SchemaTypeName] as XmlSchemaType;\r
+ XmlSchemaType type = schema.FindSchemaType (SchemaTypeName);\r
if (type != null) {\r
type.Validate (h, schema);\r
elementType = type;\r
ident.Validate (h, schema);\r
\r
#if NET_2_0\r
- elementSchemaType = elementType as XmlSchemaType;\r
- if (elementSchemaType == null && elementType != null)\r
- elementSchemaType = XmlSchemaType.GetBuiltInType (((XmlSchemaDatatype) elementType).TypeCode);\r
+ if (elementType != null) {\r
+ elementSchemaType = elementType as XmlSchemaType;\r
+ if (elementType == XmlSchemaSimpleType.AnySimpleType)\r
+ elementSchemaType = XmlSchemaSimpleType.XsAnySimpleType;\r
+ if (elementSchemaType == null)\r
+ elementSchemaType = XmlSchemaType.GetBuiltInSimpleType (SchemaTypeName);\r
+ }\r
#endif\r
\r
ValidationId = schema.ValidationId;\r
break;\r
}\r
} else {\r
- if (any.TargetNamespace.Length == 0 ||\r
- any.TargetNamespace != this.QualifiedName.Namespace)\r
+ if (any.TargetNamespace != this.QualifiedName.Namespace)\r
error (h, "Ambiguous element label which is contained by -any- particle with ##other value was detected: " + this.QualifiedName);\r
}\r
}\r