2 using System.Collections;
3 using System.Collections.Specialized;
7 namespace Commons.Xml.Nvdl
9 public class NvdlConfig
11 XmlResolver resolver = new XmlUrlResolver ();
12 ArrayList providers = new ArrayList ();
16 providers.Add (new NvdlBuiltInValidationProvider ());
19 public void AddProvider (NvdlValidationProvider provider)
21 providers.Add (provider);
24 internal XmlResolver XmlResolverInternal {
25 get { return resolver; }
28 public XmlResolver XmlResolver {
29 set { resolver = value; }
32 public NvdlValidatorGenerator GetGenerator (NvdlValidate validate, string inheritSchemaType)
34 this.resolver = this.XmlResolverInternal;
36 string schemaType = validate.SchemaType;
37 if (schemaType == null)
38 schemaType = inheritSchemaType;
39 if (schemaType == null)
40 schemaType = "application/xml";
42 foreach (NvdlValidationProvider p in providers) {
43 NvdlValidatorGenerator g =
44 p.CreateGenerator (validate, schemaType, this);
49 throw new NvdlCompileException (String.Format ("Either schema type '{0}' or the target schema document is not supported in this configuration. Add custom provider that supports this schema type.", schemaType), validate);