X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FSystem.Xml.Schema%2FXmlSchemaInclude.cs;h=7bfe81d4f14f12c58c7b2d0aa96260c22ab1e74a;hb=018c4be8c5ef6e23ccd9bf798513a6178631e1ea;hp=c592557da0a27f8a02c69977ecc3f5074e279a40;hpb=d22745d61411afd798f0b753c669e122c9628854;p=mono.git
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs
index c592557da0a..7bfe81d4f14 100755
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs
+++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs
@@ -1,5 +1,26 @@
// Author: Dwivedi, Ajay kumar
// Adwiv@Yahoo.com
+
+//
+// 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.Xml.Serialization;
using System.Xml;
@@ -12,23 +33,24 @@ namespace System.Xml.Schema
public class XmlSchemaInclude : XmlSchemaExternal
{
private XmlSchemaAnnotation annotation;
- public static string xmlname = "include";
+ const string xmlname = "include";
public XmlSchemaInclude()
{
}
- [XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
+ [XmlElement("annotation",Namespace=XmlSchema.Namespace)]
public XmlSchemaAnnotation Annotation
{
get{ return annotation; }
set{ annotation = value; }
}
-//
-// Content: (annotation?)
-//
+
+ //
+ // Content: (annotation?)
+ //
internal static XmlSchemaInclude Read(XmlSchemaReader reader, ValidationEventHandler h)
{
XmlSchemaInclude include = new XmlSchemaInclude();
@@ -55,17 +77,13 @@ namespace System.Xml.Schema
{
include.SchemaLocation = reader.Value;
}
- else if(reader.NamespaceURI == "" || reader.NamespaceURI == XmlSchema.Namespace)
+ else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
{
error(h,reader.Name + " is not a valid attribute for include",null);
}
else
{
- if(reader.Prefix == "xmlns")
- include.Namespaces.Add(reader.LocalName, reader.Value);
- else if(reader.Name == "xmlns")
- include.Namespaces.Add("",reader.Value);
- //TODO: Add to Unhandled attributes
+ XmlSchemaUtil.ReadUnhandledAttribute(reader,include);
}
}
@@ -97,4 +115,4 @@ namespace System.Xml.Schema
return include;
}
}
-}
\ No newline at end of file
+}