Пример #1
0
        private Result ValidateTemplate(string templateXml, string templateSchema)
        {
            Result result = _schemaValidator.Validate(templateSchema, templateXml);

            if (!result.Status)
            {
                return(PrefixResult(result, $"Templated CDA '{templateSchema}' schema validation"));
            }

            result = SchematronValidator.Create(SchematronDocument.TemplatedCda).Validate(templateXml);

            return(!result.Status ? PrefixResult(result, $"Templated CDA schematron validation")
                                : result);
        }
Пример #2
0
        private Result ValidateGenericCda(string inputXml, string cdaSchema)
        {
            Result result = _schemaValidator.Validate(cdaSchema, inputXml);

            if (!result.Status)
            {
                return(PrefixResult(result, $"CDA generic '{cdaSchema}' schema validation"));
            }

            result = SchematronValidator.Create(SchematronDocument.GenericCda).Validate(inputXml);

            return(!result.Status ? PrefixResult(result, $"CDA generic schematron validation")
                                : result);
        }