-// 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
{\r
private XmlSchemaContent content;\r
private static string xmlname = "simpleContent";\r
+ internal object actualBaseSchemaType;\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
/// 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
+ // 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 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
- 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
- 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
- internal int Validate(ValidationEventHandler h)\r
+ internal override int Validate(ValidationEventHandler h, XmlSchema schema)\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