public void Compile (string nss,
ValidationEventHandler h, XmlSchema schema)
{
if (SkipCompile)
return; // used by XmlSchemaAny.AnyTypeContent.
Reset ();
int nscount = 0;
string actualNamespace = nss == null ? "##any" : nss;
string[] nslist = XmlSchemaUtil.SplitList(actualNamespace);
for (int i = 0; i < nslist.Length; i++) {
string ns = nslist [i];
switch(ns) {
case "##any":
if (HasValueAny)
xsobj.error (h, "Multiple specification of ##any was found.");
nscount |= 1;
HasValueAny = true;
break;
case "##other":
if (HasValueOther)
xsobj.error (h, "Multiple specification of ##other was found.");
nscount |= 2;
HasValueOther = true;
break;
case "##targetNamespace":
if (HasValueTargetNamespace)
xsobj.error (h, "Multiple specification of ##targetNamespace was found.");
nscount |= 4;
HasValueTargetNamespace = true;
break;
case "##local":
if (HasValueLocal)
xsobj.error (h, "Multiple specification of ##local was found.");
nscount |= 8;
HasValueLocal = true;
break;
default:
if(!XmlSchemaUtil.CheckAnyUri(ns))
xsobj.error(h,"the namespace is not a valid anyURI");
else if (ResolvedNamespaces.Contains (ns))
xsobj.error (h, "Multiple specification of '" + ns + "' was found.");
else {
nscount |= 16;
ResolvedNamespaces.Add (ns);
}
break;
}
}
if((nscount&1) == 1 && nscount != 1)
xsobj.error (h, "##any if present must be the only namespace attribute");
if((nscount&2) == 2 && nscount != 2)
xsobj.error (h, "##other if present must be the only namespace attribute");
}