Exemplo n.º 1
0
        internal void CheckWhitespaceFacets(ref string s, XmlSchemaDatatype datatype)
        {
            RestrictionFacets restriction = datatype.Restriction;

            switch (datatype.Variety)
            {
            case XmlSchemaDatatypeVariety.Atomic:
                if (datatype.BuiltInWhitespaceFacet != XmlSchemaWhiteSpace.Collapse)
                {
                    if (datatype.BuiltInWhitespaceFacet == XmlSchemaWhiteSpace.Replace)
                    {
                        s = XmlComplianceUtil.CDataNormalize(s);
                    }
                    else if ((restriction != null) && ((restriction.Flags & RestrictionFlags.WhiteSpace) != 0))
                    {
                        if (restriction.WhiteSpace == XmlSchemaWhiteSpace.Replace)
                        {
                            s = XmlComplianceUtil.CDataNormalize(s);
                            return;
                        }
                        if (restriction.WhiteSpace == XmlSchemaWhiteSpace.Collapse)
                        {
                            s = XmlComplianceUtil.NonCDataNormalize(s);
                        }
                    }
                    return;
                }
                s = XmlComplianceUtil.NonCDataNormalize(s);
                return;

            case XmlSchemaDatatypeVariety.List:
                s = s.Trim();
                return;
            }
        }
 internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
 {
     typedValue = XmlComplianceUtil.NonCDataNormalize(s);
     return(null);
 }