2 // RelaxngDatatypeProvider.cs
\r
5 // Atsushi Enomoto <atsushi@ximian.com>
\r
7 // (C)2004 Novell Inc.
\r
12 using System.Xml.Schema;
\r
14 namespace Commons.Xml.Relaxng
\r
16 public abstract class RelaxngDatatypeProvider
\r
18 public abstract RelaxngDatatype GetDatatype (string name, string ns, RelaxngParamList parameters);
\r
21 internal class RelaxngNamespaceDatatypeProvider : RelaxngDatatypeProvider
\r
23 static RelaxngNamespaceDatatypeProvider instance;
\r
24 static RelaxngDatatype stringType = RelaxngString.Instance;
\r
25 static RelaxngDatatype tokenType = RelaxngToken.Instance;
\r
27 static RelaxngNamespaceDatatypeProvider ()
\r
29 instance = new RelaxngNamespaceDatatypeProvider ();
\r
32 public static RelaxngNamespaceDatatypeProvider Instance {
\r
33 get { return instance; }
\r
36 private RelaxngNamespaceDatatypeProvider () {}
\r
38 public override RelaxngDatatype GetDatatype (string name, string ns, RelaxngParamList parameters)
\r
40 if (ns != String.Empty)
\r
41 throw new RelaxngException ("Not supported data type URI");
\r
42 if (parameters != null && parameters.Count > 0)
\r
43 throw new RelaxngException ("Parameter is not allowed for this datatype: " + name);
\r