System.Xml.Schema.FacetsChecker.CheckWhitespaceFacets C# (CSharp) Méthode

CheckWhitespaceFacets() private méthode

private CheckWhitespaceFacets ( string &s, XmlSchemaDatatype datatype ) : void
s string
datatype XmlSchemaDatatype
Résultat void
        internal void CheckWhitespaceFacets(ref string s, XmlSchemaDatatype datatype) {
            // before parsing, check whitespace facet
            RestrictionFacets restriction = datatype.Restriction;

            switch (datatype.Variety) {
                case XmlSchemaDatatypeVariety.List:
                    s = s.Trim();
                break;

                case XmlSchemaDatatypeVariety.Atomic:
                    if (datatype.BuiltInWhitespaceFacet == XmlSchemaWhiteSpace.Collapse) {
                        s = XmlComplianceUtil.NonCDataNormalize(s);
                    }
                    else if (datatype.BuiltInWhitespaceFacet == XmlSchemaWhiteSpace.Replace) {
                        s = XmlComplianceUtil.CDataNormalize(s);
                    }
                    else if (restriction != null && (restriction.Flags & RestrictionFlags.WhiteSpace) != 0) { //Restriction has whitespace facet specified
                        if (restriction.WhiteSpace == XmlSchemaWhiteSpace.Replace) {
                            s = XmlComplianceUtil.CDataNormalize(s);
                        }
                        else if (restriction.WhiteSpace == XmlSchemaWhiteSpace.Collapse) {
                            s = XmlComplianceUtil.NonCDataNormalize(s);
                        }
                    }
                break;

                default:
                break;

            }
        }
        internal Exception CheckPatternFacets(RestrictionFacets restriction, string value) {