From 1dd0d8a0f17b5dd014b5b9c82e1340317201eeac Mon Sep 17 00:00:00 2001 From: markpollack Date: Sat, 20 Jun 2009 20:25:27 +0000 Subject: [PATCH] Add EMS as well known namespace --- .../Factory/Xml/NamespaceParserRegistry.cs | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs index 2207bcf3..863b5a1a 100644 --- a/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs +++ b/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs @@ -1,19 +1,19 @@ #region License -/* - * Copyright © 2002-2005 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Copyright © 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #endregion @@ -81,8 +81,8 @@ namespace Spring.Objects.Factory.Xml private static IDictionary parsers; private readonly static IDictionary wellknownNamespaceParserTypeNames; -#if !NET_2_0 - private static XmlSchemaCollection schemas; +#if !NET_2_0 + private static XmlSchemaCollection schemas; #else private static XmlSchemaSet schemas; #endif @@ -100,6 +100,7 @@ namespace Spring.Objects.Factory.Xml wellknownNamespaceParserTypeNames["http://www.springframework.net/db"] = "Spring.Data.Config.DatabaseNamespaceParser, Spring.Data"; wellknownNamespaceParserTypeNames["http://www.springframework.net/remoting"] = "Spring.Remoting.Config.RemotingNamespaceParser, Spring.Services"; wellknownNamespaceParserTypeNames["http://www.springframework.net/nms"] = "Spring.Messaging.Nms.Config.NmsNamespaceParser, Spring.Messaging.Nms"; + wellknownNamespaceParserTypeNames["http://www.springframework.net/ems"] = "Spring.Messaging.Ems.Config.EmsNamespaceParser, Spring.Messaging.Ems"; wellknownNamespaceParserTypeNames["http://www.springframework.net/validation"] = "Spring.Validation.Config.ValidationNamespaceParser, Spring.Core"; Reset(); @@ -112,8 +113,8 @@ namespace Spring.Objects.Factory.Xml public static void Reset() { parsers = new HybridDictionary(); -#if !NET_2_0 - schemas = new XmlSchemaCollection(); +#if !NET_2_0 + schemas = new XmlSchemaCollection(); #else schemas = new XmlSchemaSet(); schemas.XmlResolver = new XmlResourceUrlResolver(); @@ -193,8 +194,8 @@ namespace Spring.Objects.Factory.Xml /// /// A schema collection containing validation schemas for all registered parsers. /// -#if !NET_2_0 - public static XmlSchemaCollection GetSchemas() +#if !NET_2_0 + public static XmlSchemaCollection GetSchemas() #else public static XmlSchemaSet GetSchemas() #endif @@ -392,12 +393,12 @@ namespace Spring.Objects.Factory.Xml IResource schema = resourceLoader.GetResource(schemaLocation); try { -#if NET_1_0 +#if NET_1_0 XmlTextReader schemaDocument = new XmlTextReader(schemaLocation, schema.InputStream); - schemas.Add(namespaceUri, schemaDocument); -#elif NET_1_1 + schemas.Add(namespaceUri, schemaDocument); +#elif NET_1_1 XmlTextReader schemaDocument = new XmlTextReader(schemaLocation, schema.InputStream); - schemas.Add(namespaceUri, schemaDocument, new XmlResourceUrlResolver()); + schemas.Add(namespaceUri, schemaDocument, new XmlResourceUrlResolver()); #else XmlTextReader schemaDocument = new XmlTextReader(schema.Uri.AbsoluteUri, schema.InputStream); schemas.Add(namespaceUri, schemaDocument);