public static XmlReaderSettings Create <T1, T2, T3>(XmlSchemaContentProcessing contentProcessing)
     where T1 : SchemaBase, new()
     where T2 : SchemaBase, new()
     where T3 : SchemaBase, new()
 {
     return(ValidatingXmlReaderSettingsBase.Create(contentProcessing, new T1().CreateResolvedSchema(), new T2().CreateResolvedSchema(), new T3().CreateResolvedSchema()));
 }
示例#2
0
 public static XmlReaderSettings Create <T1, T2, T3, T4, T5, T6>(XmlSchemaContentProcessing contentProcessing = XmlSchemaContentProcessing.Strict)
     where T1 : SchemaBase, new()
     where T2 : SchemaBase, new()
     where T3 : SchemaBase, new()
     where T4 : SchemaBase, new()
     where T5 : SchemaBase, new()
     where T6 : SchemaBase, new()
 {
     return(ValidatingXmlReaderSettingsBase.Create(
                contentProcessing,
                new T1().CreateResolvedSchema(),
                new T2().CreateResolvedSchema(),
                new T3().CreateResolvedSchema(),
                new T4().CreateResolvedSchema(),
                new T5().CreateResolvedSchema(),
                new T6().CreateResolvedSchema()));
 }
        private XmlReader CreateValidationAwareReader(Stream transformStream)
        {
            var validatingXmlReader = XmlReader.Create(
                transformStream,
                ValidatingXmlReaderSettings.Create(
                    ContentProcessing,
                    (sender, args) => {
                throw new XmlSchemaValidationException(
                    string.Format(
                        "Transform's output failed schema(s) validation for the following reason:{0}{1}: {2}{0}{0}The message's content is:{0}{3}{0}",
                        Environment.NewLine,
                        args.Severity,
                        args.Message,
                        transformStream.ReadToEnd()),
                    args.Exception);
            },
                    Schemas.ToArray()));

            return(validatingXmlReader);
        }
示例#4
0
 public static XmlReaderSettings Create <T>(XmlSchemaContentProcessing contentProcessing = XmlSchemaContentProcessing.Strict) where T : SchemaBase, new()
 {
     return(ValidatingXmlReaderSettingsBase.Create(contentProcessing, new T().CreateResolvedSchema()));
 }