Selaa lähdekoodia

2004-06-03 Atsushi Enomoto <[email protected]>

	* BuiltInDatatype.cs,
	  XmlSchemaFacet.cs,
	  XmlSchemaSimpleTypeRestriction.cs,
	  XmlSchemaXPath.cs : modified some enum const to static readonly
	  (.NET 1.0 does not allow it). Use safe overload of LookupNamespace().

svn path=/trunk/mcs/; revision=28790
Atsushi Eno 21 vuotta sitten
vanhempi
sitoutus
bba3fd5d13

+ 6 - 5
mcs/class/System.XML/System.Xml.Schema/BuiltInDatatype.cs

@@ -127,12 +127,12 @@ namespace Mono.Xml.Schema
 
 		/* Matches facets allowed on boolean type
 		 */
-		internal const XmlSchemaFacet.Facet booleanAllowedFacets = 
+		internal static readonly XmlSchemaFacet.Facet booleanAllowedFacets = 
 					 XmlSchemaFacet.Facet.pattern | XmlSchemaFacet.Facet.whiteSpace;
 
 		/* Matches facets allowed on decimal type. 
 		 */
-		internal const XmlSchemaFacet.Facet decimalAllowedFacets = 
+		internal static readonly XmlSchemaFacet.Facet decimalAllowedFacets = 
 							XmlSchemaFacet.Facet.pattern | XmlSchemaFacet.Facet.enumeration | 
 							XmlSchemaFacet.Facet.whiteSpace | XmlSchemaFacet.Facet.maxInclusive | 
 							XmlSchemaFacet.Facet.minInclusive | XmlSchemaFacet.Facet.maxExclusive | 
@@ -143,7 +143,7 @@ namespace Mono.Xml.Schema
 		 * gYearMonth, gYear, gMonthDay, gMonth, and gDay types
 		 */
 
-		internal const XmlSchemaFacet.Facet durationAllowedFacets = 
+		internal static readonly XmlSchemaFacet.Facet durationAllowedFacets = 
 							XmlSchemaFacet.Facet.pattern | XmlSchemaFacet.Facet.enumeration | 
 							XmlSchemaFacet.Facet.whiteSpace | XmlSchemaFacet.Facet.maxInclusive |
 							XmlSchemaFacet.Facet.minInclusive | XmlSchemaFacet.Facet.maxExclusive |
@@ -155,7 +155,7 @@ namespace Mono.Xml.Schema
 		 * Also used on list types
 		 */
 
-		internal const XmlSchemaFacet.Facet stringAllowedFacets = 
+		internal static readonly XmlSchemaFacet.Facet stringAllowedFacets = 
 						 XmlSchemaFacet.Facet.length | XmlSchemaFacet.Facet.minLength |
 						 XmlSchemaFacet.Facet.maxLength | XmlSchemaFacet.Facet.pattern | 
 						 XmlSchemaFacet.Facet.enumeration | XmlSchemaFacet.Facet.whiteSpace; 
@@ -1272,7 +1272,8 @@ namespace Mono.Xml.Schema
 			string localName = colonAt < 0 ? s : s.Substring (colonAt + 1);
 //			string localName = nameTable.Add (colonAt < 0 ? s : s.Substring (colonAt + 1));
 			return new XmlQualifiedName (localName, nsmgr.LookupNamespace (
-				colonAt < 0 ? "" : s.Substring (0, colonAt - 1)));
+				colonAt < 0 ? "" : s.Substring (0, colonAt - 1),
+				false));
 		}
 
 		internal override ValueType ParseValueType (string s, XmlNameTable nameTable, XmlNamespaceManager nsmgr) 

+ 8 - 0
mcs/class/System.XML/System.Xml.Schema/ChangeLog

@@ -1,3 +1,11 @@
+2004-06-03  Atsushi Enomoto <[email protected]>
+
+	* BuiltInDatatype.cs,
+	  XmlSchemaFacet.cs,
+	  XmlSchemaSimpleTypeRestriction.cs,
+	  XmlSchemaXPath.cs : modified some enum const to static readonly
+	  (.NET 1.0 does not allow it). Use safe overload of LookupNamespace().
+
 2004-05-22  Atsushi Enomoto <[email protected]>
 
 	* XmlSchemaDatatypeVariety.cs,

+ 1 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs

@@ -30,7 +30,7 @@ namespace System.Xml.Schema
 			fractionDigits = 2048
 		};
  
-		internal protected const Facet AllFacets = 
+		internal protected static readonly Facet AllFacets = 
 		                        Facet.length | Facet.minLength |  Facet.maxLength |
 					Facet.minExclusive | Facet.maxExclusive |
 					Facet.minInclusive | Facet.maxInclusive |

+ 1 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs

@@ -110,7 +110,7 @@ namespace System.Xml.Schema
 			* not been fixed in the baseType. That is done elsewhere.
 			*/
 		
-		private const XmlSchemaFacet.Facet listFacets =
+		private static readonly XmlSchemaFacet.Facet listFacets =
 						 XmlSchemaFacet.Facet.length | XmlSchemaFacet.Facet.minLength |
 						 XmlSchemaFacet.Facet.maxLength | XmlSchemaFacet.Facet.pattern | 
 						 XmlSchemaFacet.Facet.enumeration | XmlSchemaFacet.Facet.whiteSpace; 

+ 3 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs

@@ -179,7 +179,7 @@ namespace System.Xml.Schema
 					string prefix = xpath.Substring (nameStart, pos - nameStart);
 					pos++;
 					if (xpath.Length > pos && xpath [pos] == '*') {
-						string ns = nsmgr.LookupNamespace (prefix);
+						string ns = nsmgr.LookupNamespace (prefix, false);
 						if (ns == null) {
 							error (h, "Specified prefix '" + prefix + "' is not declared.");
 							this.currentPath = null;
@@ -196,7 +196,7 @@ namespace System.Xml.Schema
 								pos++;
 						}
 						step.Name = xpath.Substring (localNameStart, pos - localNameStart);
-						string ns = nsmgr.LookupNamespace (prefix);
+						string ns = nsmgr.LookupNamespace (prefix, false);
 						if (ns == null) {
 							error (h, "Specified prefix '" + prefix + "' is not declared.");
 							this.currentPath = null;
@@ -291,7 +291,7 @@ namespace System.Xml.Schema
 					case "xmlns":
 						continue;
 					default:
-						path.nsmgr.AddNamespace (prefix, currentMgr.LookupNamespace (prefix));
+						path.nsmgr.AddNamespace (prefix, currentMgr.LookupNamespace (prefix, false));
 						break;
 					}
 				}