private XmlQualifiedName schemaTypeName;\r
private XmlQualifiedName substitutionGroup;\r
internal bool parentIsSchema = false;\r
- private string targetNamespace;\r
private string validatedDefaultValue;\r
private string validatedFixedValue;\r
internal bool actualIsAbstract;\r
/// 5. abstract is prohibited\r
/// 6. default and fixed must not both be present.(Actually both are absent)\r
/// </remarks> \r
- [MonoTODO]\r
internal override int Compile(ValidationEventHandler h, XmlSchema schema)\r
{\r
// If this is already compiled this time, simply skip.\r
error(h,"substitutionGroup must be absent");\r
if(final != XmlSchemaDerivationMethod.None)\r
error(h,"final must be absent");\r
- // This is not W3C REC 3.3.3 requirement\r
-// if(isAbstract)\r
-// error(h,"abstract must be absent");\r
\r
CompileOccurence (h, schema);\r
\r
if(refName == null || RefName.IsEmpty)\r
{\r
+ string targetNamespace = String.Empty;\r
+\r
if(form == XmlSchemaForm.Qualified || (form == XmlSchemaForm.None && schema.ElementFormDefault == XmlSchemaForm.Qualified))\r
- this.targetNamespace = schema.TargetNamespace;\r
- else\r
- this.targetNamespace = "";\r
+ targetNamespace = schema.TargetNamespace;\r
\r
if(this.name == null) //b1\r
error(h,"Required attribute name must be present");\r
else if(!XmlSchemaUtil.CheckNCName(this.name)) // b1.2\r
error(h,"attribute name must be NCName");\r
else\r
- this.qName = new XmlQualifiedName(this.name, this.targetNamespace);\r
+ this.qName = new XmlQualifiedName(this.name, targetNamespace);\r
\r
- /*\r
- XmlSchemaDerivationMethod allblock = XmlSchemaDerivationMethod.Extension | \r
- XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Substitution;\r
-\r
- if(block == XmlSchemaDerivationMethod.All)\r
- blockResolved = allblock;\r
-// else if(block == XmlSchemaDerivationMethod.None)\r
-// blockResolved = allblock;\r
- else\r
- {\r
- if((block & ~allblock) != 0)\r
- warn(h,"Some of the values for block are invalid in this context");\r
- blockResolved = block & allblock;\r
- }\r
- */\r
-\r
if(schemaType != null && schemaTypeName != null && !schemaTypeName.IsEmpty)\r
{\r
error(h,"both schemaType and content can't be present");\r
return errorCount;\r
}\r
\r
- [MonoTODO]\r
internal override int Validate(ValidationEventHandler h, XmlSchema schema)\r
{\r
if (IsValidated (schema.CompilationId))\r
continue;\r
if (any.HasValueAny ||\r
any.HasValueLocal && this.QualifiedName.Namespace == "" ||\r
- any.HasValueOther && this.QualifiedName.Namespace != this.targetNamespace ||\r
- any.HasValueTargetNamespace && this.QualifiedName.Namespace == this.targetNamespace) {\r
+ any.HasValueOther && this.QualifiedName.Namespace != this.QualifiedName.Namespace ||\r
+ any.HasValueTargetNamespace && this.QualifiedName.Namespace == this.QualifiedName.Namespace) {\r
error (h, "Ambiguous element label which is contained by -any- particle was detected: " + this.QualifiedName);\r
break;\r
- } else {\r
+ } else if (!any.HasValueOther) {\r
bool bad = false;\r
foreach (string ns in any.ResolvedNamespaces) {\r
if (ns == this.QualifiedName.Namespace) {\r
error (h, "Ambiguous element label which is contained by -any- particle was detected: " + this.QualifiedName);\r
break;\r
}\r
+ } else {\r
+ if (any.TargetNamespace.Length == 0 ||\r
+ 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
qnames.Add (this.QualifiedName, this);\r