コード例 #1
0
        public static SchematronValidationResultPattern Parse(XPathNavigator navigator)
        {
            var document = navigator.GetAttribute("document", "");
            var id       = navigator.GetAttribute("id", "");
            var name     = navigator.GetAttribute("name", "");
            var pattern  = new SchematronValidationResultPattern(document, id, name);

            while (navigator.MoveToNext())
            {
                if (navigator.LocalName != "fired-rule")
                {
                    navigator.MoveToPrevious();
                    break;
                }

                var rule = SchematronValidationResultPatternRule.Parse(navigator);
                pattern.Rules.Add(rule);
            }

            return(pattern);
        }
コード例 #2
0
        public static SchematronValidationResultPatternRule Parse(XPathNavigator navigator)
        {
            var context = navigator.GetAttribute("context", "");
            var id      = navigator.GetAttribute("id", "");
            var rule    = new SchematronValidationResultPatternRule(context, id);

            while (navigator.MoveToNext())
            {
                if (navigator.LocalName == "failed-assert" || navigator.LocalName == "successful-report")
                {
                    var result = SchematronValidationResultPatternRuleResult.Parse(navigator);
                    rule.Results.Add(result);
                }
                else
                {
                    navigator.MoveToPrevious();
                    break;
                }
            }

            return(rule);
        }