projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2003-09-30 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
[mono.git]
/
mcs
/
class
/
System.XML
/
System.Xml.Schema
/
XmlSchemaSimpleContent.cs
diff --git
a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
index a1c3daf13380ea70b3c74e1caef082d742cd8392..044c6f3e4d9923f8390299a682a416d7326066f1 100755
(executable)
--- a/
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
+++ b/
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
@@
-1,5
+1,10
@@
-// Author: Dwivedi, Ajay kumar
\r
-// Adwiv@Yahoo.com
\r
+//
\r
+// System.Xml.Schema.XmlSchemaSimpleContent.cs
\r
+//
\r
+// Author:
\r
+// Dwivedi, Ajay kumar Adwiv@Yahoo.com
\r
+// Atsushi Enomoto ginga@kit.hi-ho.ne.jp
\r
+//
\r
using System;
\r
using System.Xml.Serialization;
\r
using System.Xml;
\r
using System;
\r
using System.Xml.Serialization;
\r
using System.Xml;
\r
@@
-13,12
+18,13
@@
namespace System.Xml.Schema
{
\r
private XmlSchemaContent content;
\r
private static string xmlname = "simpleContent";
\r
{
\r
private XmlSchemaContent content;
\r
private static string xmlname = "simpleContent";
\r
+ internal object actualBaseSchemaType;
\r
public XmlSchemaSimpleContent()
\r
{
\r
}
\r
\r
public XmlSchemaSimpleContent()
\r
{
\r
}
\r
\r
- [XmlElement("restriction",typeof(XmlSchemaSimpleContentRestriction),Namespace=
"http://www.w3.org/2001/XMLSchema"
)]
\r
- [XmlElement("extension",typeof(XmlSchemaSimpleContentExtension),Namespace=
"http://www.w3.org/2001/XMLSchema"
)]
\r
+ [XmlElement("restriction",typeof(XmlSchemaSimpleContentRestriction),Namespace=
XmlSchema.Namespace
)]
\r
+ [XmlElement("extension",typeof(XmlSchemaSimpleContentExtension),Namespace=
XmlSchema.Namespace
)]
\r
public override XmlSchemaContent Content
\r
{
\r
get{ return content; }
\r
public override XmlSchemaContent Content
\r
{
\r
get{ return content; }
\r
@@
-29,8
+35,12
@@
namespace System.Xml.Schema
/// 1. Content must be present and one of restriction or extention
\r
///</remarks>
\r
[MonoTODO]
\r
/// 1. Content must be present and one of restriction or extention
\r
///</remarks>
\r
[MonoTODO]
\r
- internal
int Compile(ValidationEventHandler h, XmlSchemaInfo info
)
\r
+ internal
override int Compile(ValidationEventHandler h, XmlSchema schema
)
\r
{
\r
{
\r
+ // If this is already compiled this time, simply skip.
\r
+ if (this.IsComplied (schema.CompilationId))
\r
+ return 0;
\r
+
\r
if(Content == null)
\r
{
\r
error(h, "Content must be present in a simpleContent");
\r
if(Content == null)
\r
{
\r
error(h, "Content must be present in a simpleContent");
\r
@@
-40,24
+50,31
@@
namespace System.Xml.Schema
if(Content is XmlSchemaSimpleContentRestriction)
\r
{
\r
XmlSchemaSimpleContentRestriction xscr = (XmlSchemaSimpleContentRestriction) Content;
\r
if(Content is XmlSchemaSimpleContentRestriction)
\r
{
\r
XmlSchemaSimpleContentRestriction xscr = (XmlSchemaSimpleContentRestriction) Content;
\r
- errorCount += xscr.Compile(h,
info
);
\r
+ errorCount += xscr.Compile(h,
schema
);
\r
}
\r
else if(Content is XmlSchemaSimpleContentExtension)
\r
{
\r
XmlSchemaSimpleContentExtension xsce = (XmlSchemaSimpleContentExtension) Content;
\r
}
\r
else if(Content is XmlSchemaSimpleContentExtension)
\r
{
\r
XmlSchemaSimpleContentExtension xsce = (XmlSchemaSimpleContentExtension) Content;
\r
- errorCount += xsce.Compile(h,
info
);
\r
+ errorCount += xsce.Compile(h,
schema
);
\r
}
\r
else
\r
error(h,"simpleContent can't have any value other than restriction or extention");
\r
}
\r
\r
}
\r
else
\r
error(h,"simpleContent can't have any value other than restriction or extention");
\r
}
\r
\r
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
\r
+ XmlSchemaUtil.CompileID(Id,this, schema.IDCollection,h);
\r
+ this.CompilationId = schema.CompilationId;
\r
return errorCount;
\r
}
\r
\r
[MonoTODO]
\r
return errorCount;
\r
}
\r
\r
[MonoTODO]
\r
- internal
int Validate(ValidationEventHandler h
)
\r
+ internal
override int Validate(ValidationEventHandler h, XmlSchema schema
)
\r
{
\r
{
\r
+ if (IsValidated (schema.ValidationId))
\r
+ return errorCount;
\r
+
\r
+ errorCount += this.Content.Validate (h, schema);
\r
+
\r
+ ValidationId = schema.ValidationId;
\r
return errorCount;
\r
}
\r
//<simpleContent
\r
return errorCount;
\r
}
\r
//<simpleContent
\r
@@
-87,17
+104,13
@@
namespace System.Xml.Schema
{
\r
simple.Id = reader.Value;
\r
}
\r
{
\r
simple.Id = reader.Value;
\r
}
\r
- else if(
reader.NamespaceURI == ""
|| reader.NamespaceURI == XmlSchema.Namespace)
\r
+ else if(
(reader.NamespaceURI == "" && reader.Name != "xmlns")
|| reader.NamespaceURI == XmlSchema.Namespace)
\r
{
\r
error(h,reader.Name + " is not a valid attribute for simpleContent",null);
\r
}
\r
else
\r
{
\r
{
\r
error(h,reader.Name + " is not a valid attribute for simpleContent",null);
\r
}
\r
else
\r
{
\r
- if(reader.Prefix == "xmlns")
\r
- simple.Namespaces.Add(reader.LocalName, reader.Value);
\r
- else if(reader.Name == "xmlns")
\r
- simple.Namespaces.Add("",reader.Value);
\r
- //TODO: Add to Unhandled attributes
\r
+ XmlSchemaUtil.ReadUnhandledAttribute(reader,simple);
\r
}
\r
}
\r
\r
}
\r
}
\r
\r