diff options
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs')
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs b/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs index 280049c298e..e74617150bf 100644 --- a/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs +++ b/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs @@ -1,36 +1,36 @@ -// -// Mono.Xml.Schema.XsdWildcard.cs -// -// Author: -// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp) -// -// (C)2003 Atsushi Enomoto -// -// -// This class represents common part of xs:any and xs:anyAttribute -// -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +//
+// Mono.Xml.Schema.XsdWildcard.cs
+//
+// Author:
+// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
+//
+// (C)2003 Atsushi Enomoto
+//
+//
+// This class represents common part of xs:any and xs:anyAttribute
+//
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
using System;
using System.Collections.Specialized;
using System.Xml;
@@ -75,42 +75,42 @@ namespace Mono.Xml.Schema 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]; + 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."); + if (HasValueAny)
+ xsobj.error (h, "Multiple specification of ##any was found.");
nscount |= 1;
- HasValueAny = true; + HasValueAny = true;
break;
case "##other":
- if (HasValueOther) - xsobj.error (h, "Multiple specification of ##other was found."); + if (HasValueOther)
+ xsobj.error (h, "Multiple specification of ##other was found.");
nscount |= 2;
- HasValueOther = true; + HasValueOther = true;
break;
case "##targetNamespace":
- if (HasValueTargetNamespace) - xsobj.error (h, "Multiple specification of ##targetNamespace was found."); + 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."); + if (HasValueLocal)
+ xsobj.error (h, "Multiple specification of ##local was found.");
nscount |= 8;
- HasValueLocal = true; + 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 if (ResolvedNamespaces.Contains (ns))
+ xsobj.error (h, "Multiple specification of '" + ns + "' was found.");
else {
nscount |= 16;
- ResolvedNamespaces.Add (ns); - } + ResolvedNamespaces.Add (ns);
+ }
break;
}
}
@@ -186,20 +186,20 @@ namespace Mono.Xml.Schema public bool ValidateWildcardAllowsNamespaceName (string ns,
ValidationEventHandler h, XmlSchema schema, bool raiseError)
{
- if (HasValueAny) - return true; - if (HasValueOther && ns != TargetNamespace) - return true; - if (HasValueTargetNamespace && ns == TargetNamespace) - return true; - if (HasValueLocal && ns == "") - return true; - for (int i = 0; i < ResolvedNamespaces.Count; i++) - if (ns == ResolvedNamespaces [i]) - return true; - if (raiseError) - xsobj.error (h, "This wildcard does not allow the namespace: " + ns); - return false; + if (HasValueAny)
+ return true;
+ if (HasValueOther && ns != TargetNamespace)
+ return true;
+ if (HasValueTargetNamespace && ns == TargetNamespace)
+ return true;
+ if (HasValueLocal && ns == "")
+ return true;
+ for (int i = 0; i < ResolvedNamespaces.Count; i++)
+ if (ns == ResolvedNamespaces [i])
+ return true;
+ if (raiseError)
+ xsobj.error (h, "This wildcard does not allow the namespace: " + ns);
+ return false;
}
// 3.10.6 Wildcard Subset
|