diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2008-06-06 14:15:03 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2008-06-06 14:15:03 +0400 |
commit | 1c769c95182b4fcbf0f0626e9d5c7d610da03e98 (patch) | |
tree | a1384ded86a0ea2eab7eda56e277a416153774ff /mcs/class/System.XML/System.Xml.Schema | |
parent | 13bc5269f3613059954d5dc3ac60ab08e39cc764 (diff) |
2008-06-06 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchema.cs : indent (I slightly modified the previous patch
to expose the actual changes).
svn path=/trunk/mcs/; revision=105145
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Schema')
-rw-r--r-- | mcs/class/System.XML/System.Xml.Schema/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs | 94 |
2 files changed, 52 insertions, 47 deletions
diff --git a/mcs/class/System.XML/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/System.Xml.Schema/ChangeLog index cabc0d81685..43418113e6c 100644 --- a/mcs/class/System.XML/System.Xml.Schema/ChangeLog +++ b/mcs/class/System.XML/System.Xml.Schema/ChangeLog @@ -1,5 +1,10 @@ 2008-06-06 Atsushi Enomoto <atsushi@ximian.com> + * XmlSchema.cs : indent (I slightly modified the previous patch + to expose the actual changes). + +2008-06-06 Atsushi Enomoto <atsushi@ximian.com> + * XmlSchema.cs : fixed bug #397612, patch by James Fitzsimons. in ProcessExternal(), Make xs:import without schemaLocation work fine as if it were with schemaLocation. diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs index 9851f10c024..36918312f74 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs @@ -489,59 +489,59 @@ namespace System.Xml.Schema return; XmlSchema includedSchema = null; - if (ext.SchemaLocation != null) - { - Stream stream = null; - string url = null; - if (resolver != null) { - url = GetResolvedUri (resolver, ext.SchemaLocation); - if (handledUris.Contains (url)) - // This schema is already handled, so simply skip (otherwise, duplicate definition errrors occur. - return; - handledUris.Add (url, url); - try { - stream = resolver.GetEntity (new Uri (url), null, typeof (Stream)) as Stream; - } catch (Exception) { - // LAMESPEC: This is not good way to handle errors, but since we cannot know what kind of XmlResolver will come, so there are no mean to avoid this ugly catch. - warn (handler, "Could not resolve schema location URI: " + url); - stream = null; + if (ext.SchemaLocation != null) + { + Stream stream = null; + string url = null; + if (resolver != null) { + url = GetResolvedUri (resolver, ext.SchemaLocation); + if (handledUris.Contains (url)) + // This schema is already handled, so simply skip (otherwise, duplicate definition errrors occur. + return; + handledUris.Add (url, url); + try { + stream = resolver.GetEntity (new Uri (url), null, typeof (Stream)) as Stream; + } catch (Exception) { + // LAMESPEC: This is not good way to handle errors, but since we cannot know what kind of XmlResolver will come, so there are no mean to avoid this ugly catch. + warn (handler, "Could not resolve schema location URI: " + url); + stream = null; + } } - } - // Process redefinition children in advance. - XmlSchemaRedefine redefine = ext as XmlSchemaRedefine; - if (redefine != null) { - for (int j = 0; j < redefine.Items.Count; j++) { - XmlSchemaObject redefinedObj = redefine.Items [j]; - redefinedObj.isRedefinedComponent = true; - redefinedObj.isRedefineChild = true; - if (redefinedObj is XmlSchemaType || - redefinedObj is XmlSchemaGroup || - redefinedObj is XmlSchemaAttributeGroup) - compilationItems.Add (redefinedObj); - else - error (handler, "Redefinition is only allowed to simpleType, complexType, group and attributeGroup."); + // Process redefinition children in advance. + XmlSchemaRedefine redefine = ext as XmlSchemaRedefine; + if (redefine != null) { + for (int j = 0; j < redefine.Items.Count; j++) { + XmlSchemaObject redefinedObj = redefine.Items [j]; + redefinedObj.isRedefinedComponent = true; + redefinedObj.isRedefineChild = true; + if (redefinedObj is XmlSchemaType || + redefinedObj is XmlSchemaGroup || + redefinedObj is XmlSchemaAttributeGroup) + compilationItems.Add (redefinedObj); + else + error (handler, "Redefinition is only allowed to simpleType, complexType, group and attributeGroup."); + } } - } - if (stream == null) { - // It is missing schema components. - missedSubComponents = true; - return; - } else { - XmlTextReader xtr = null; - try { - xtr = new XmlTextReader (url, stream, nameTable); - includedSchema = XmlSchema.Read (xtr, handler); - } finally { - if (xtr != null) - xtr.Close (); + if (stream == null) { + // It is missing schema components. + missedSubComponents = true; + return; + } else { + XmlTextReader xtr = null; + try { + xtr = new XmlTextReader (url, stream, nameTable); + includedSchema = XmlSchema.Read (xtr, handler); + } finally { + if (xtr != null) + xtr.Close (); + } + includedSchema.schemas = schemas; } - includedSchema.schemas = schemas; + includedSchema.SetParent (); + ext.Schema = includedSchema; } - includedSchema.SetParent (); - ext.Schema = includedSchema; - } // Set - actual - target namespace for the included schema * before compilation*. if (import != null) { |