Merge pull request #1155 from steffen-kiess/json-string
[mono.git] / mcs / class / Commons.Xml.Relaxng / Commons.Xml.Nvdl / NvdlValidationProvider.cs
index 38647377f3dc831d25d56d172bc3c2d08740203a..0501b0e3b38b76548e498f38ba264b512b46f071 100644 (file)
@@ -8,8 +8,16 @@ namespace Commons.Xml.Nvdl
 {
        public class NvdlValidationProvider
        {
+               NvdlValidate validate;
+               string schema_type;
+               NvdlConfig config;
+
                public virtual NvdlValidatorGenerator CreateGenerator (NvdlValidate validate, string schemaType, NvdlConfig config)
                {
+                       this.validate = validate;
+                       this.schema_type = schemaType;
+                       this.config = config;
+
                        XmlReader schema = null;
                        // FIXME: we need a bit more strict check.
                        if (schemaType.Length < 5 ||
@@ -42,6 +50,18 @@ namespace Commons.Xml.Nvdl
                        return CreateGenerator (schema, config);
                }
 
+               public NvdlValidate ValidateAction {
+                       get { return validate; }
+               }
+
+               public NvdlConfig Config {
+                       get { return config; }
+               }
+
+               public string SchemaType {
+                       get { return schema_type; }
+               }
+
                public virtual NvdlValidatorGenerator CreateGenerator (XmlReader schema, NvdlConfig config)
                {
                        return null;
@@ -92,5 +112,10 @@ namespace Commons.Xml.Nvdl
                }
 
                public abstract bool AddOption (string name, string arg);
+
+               public virtual bool HandleError (Exception ex, XmlReader reader, string nvdlLocation)
+               {
+                       return false;
+               }
        }
 }