X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FCommons.Xml.Relaxng%2FCommons.Xml.Relaxng.Derivative%2FRdpObjects.cs;h=27727056a828213b40338cc05f5ec95220d6b190;hb=d79280674bec813a7bdf8fd314a3538ea5a5f56f;hp=531fd050fe93492f9e6674dada1212793f366b1b;hpb=6b6435d1b3206b0162c37e5ecce8d9a699fe6467;p=mono.git diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng.Derivative/RdpObjects.cs b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng.Derivative/RdpObjects.cs index 531fd050fe9..27727056a82 100644 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng.Derivative/RdpObjects.cs +++ b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng.Derivative/RdpObjects.cs @@ -1,14 +1,14 @@ -// -// Commons.Xml.Relaxng.Derivative.RdpObjects.cs -// -// Author: -// Atsushi Enomoto -// -// 2003 Atsushi Enomoto "No rights reserved." -// -// Copyright (c) 2004 Novell Inc. -// All rights reserved -// +// +// Commons.Xml.Relaxng.Derivative.RdpObjects.cs +// +// Author: +// Atsushi Enomoto +// +// 2003 Atsushi Enomoto "No rights reserved." +// +// Copyright (c) 2004 Novell Inc. +// All rights reserved +// // // Permission is hereby granted, free of charge, to any person obtaining @@ -30,83 +30,85 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // - -using System; -using System.Collections; -using System.Collections.Specialized; -using System.Xml; - -namespace Commons.Xml.Relaxng.Derivative -{ - /// - /// Datatype Related Classes - /// - public class RdpParamList : ArrayList - { - public RdpParamList () : base () - { - } - } - - public class RdpParam - { - public RdpParam (string localName, string value) - { - this.localName = localName; - this.value = value; - } - - string value; - public string Value { - get { return this.value; } - } - - string localName; - public string LocalName { - get { return localName; } - } - } - - public class RdpDatatype - { - RelaxngDatatypeProvider provider; - string localName; - string ns; - RelaxngDatatype datatype; - - public RdpDatatype (string ns, string localName, RelaxngParamList parameters, RelaxngDatatypeProvider provider) - { - this.ns = ns; - this.localName = localName; - this.provider = provider; - if (provider == null) - provider = RelaxngMergedProvider.DefaultProvider; - datatype = provider.GetDatatype (localName, ns, parameters); - if (datatype == null) { - throw new RelaxngException (String.Format ("Invalid datatype was found for namespace '{0}' and local name '{1}'", ns, localName)); - } - } - - public string NamespaceURI { - get { return ns; } - } - - public string LocalName { - get { return localName; } - } - - public virtual bool IsAllowed (string value, XmlReader reader) - { - return datatype.IsValid (value, reader); - } - - static char [] wsChars = new char [] {' ', '\n', '\r', '\t'}; - - public virtual bool IsTypeEqual (string s1, string s2, XmlReader reader) - { - return datatype.CompareString (s1, s2, reader); - } - } - -} - + +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Xml; + +namespace Commons.Xml.Relaxng.Derivative +{ + /// + /// Datatype Related Classes + /// + public class RdpParamList : ArrayList + { + public RdpParamList () : base () + { + } + } + + public class RdpParam + { + public RdpParam (string localName, string value) + { + this.localName = localName; + this.value = value; + } + + string value; + public string Value { + get { return this.value; } + } + + string localName; + public string LocalName { + get { return localName; } + } + } + + public class RdpDatatype + { + //RelaxngDatatypeProvider provider; + string localName; + string ns; + RelaxngDatatype datatype; + + public RdpDatatype (string ns, string localName, RelaxngParamList parameters, RelaxngDatatypeProvider provider) + { + this.ns = ns; + this.localName = localName; + //this.provider = provider; + if (provider == null) + provider = RelaxngMergedProvider.DefaultProvider; + datatype = provider.GetDatatype (localName, ns, parameters); + if (datatype == null) { + throw new RelaxngException (String.Format ("Invalid datatype was found for namespace '{0}' and local name '{1}'", ns, localName)); + } + } + + public string NamespaceURI { + get { return ns; } + } + + public string LocalName { + get { return localName; } + } + + public bool IsContextDependent { + get { return datatype.IsContextDependent; } + } + + public virtual bool IsAllowed (string value, XmlReader reader) + { + return datatype.IsValid (value, reader); + } + + public virtual bool IsTypeEqual (string s1, string s2, XmlReader reader) + { + return datatype.CompareString (s1, s2, reader); + } + } + +} +