Пример #1
0
        internal XssFilterInfo(string schemaLocation)
        {
            XmlDocument schemaDoc = GetSchemaDoc(schemaLocation);
            XmlReader schemaReader = new XmlNodeReader(schemaDoc);
            try
            {
                Schema = XmlSchema.Read(schemaReader, null);
            }
            finally
            {
                schemaReader.Close();
            }

            Schema.Compile(null);
            if (Type.GetType("Mono.Runtime", false) != null)
            {
                UriAndStyleValidator = new AttributeValueValidator();
                UriAndStyleValidator.Add(schemaDoc, Schema, "URI", Schema.TargetNamespace);
                UriAndStyleValidator.Add(schemaDoc, Schema, "InlineStyle", Schema.TargetNamespace);
                // NOTE: We don't bother with attributes of type "URIs" (plural) because only <object> has such an
                // attribute and we don't allow that element.
            }
        }
Пример #2
0
        internal XssFilterInfo(string schemaLocation)
        {
            XmlDocument schemaDoc    = GetSchemaDoc(schemaLocation);
            XmlReader   schemaReader = new XmlNodeReader(schemaDoc);

            try
            {
                Schema = XmlSchema.Read(schemaReader, null);
            }
            finally
            {
                schemaReader.Close();
            }

            Schema.Compile(null);
            if (Type.GetType("Mono.Runtime", false) != null)
            {
                UriAndStyleValidator = new AttributeValueValidator();
                UriAndStyleValidator.Add(schemaDoc, Schema, "URI", Schema.TargetNamespace);
                UriAndStyleValidator.Add(schemaDoc, Schema, "InlineStyle", Schema.TargetNamespace);
                // NOTE: We don't bother with attributes of type "URIs" (plural) because only <object> has such an
                // attribute and we don't allow that element.
            }
        }