OLD | NEW |
1 /* | 1 /* |
2 * schematron.c : implementation of the Schematron schema validity checking | 2 * schematron.c : implementation of the Schematron schema validity checking |
3 * | 3 * |
4 * See Copyright for the status of this software. | 4 * See Copyright for the status of this software. |
5 * | 5 * |
6 * Daniel Veillard <daniel@veillard.com> | 6 * Daniel Veillard <daniel@veillard.com> |
7 */ | 7 */ |
8 | 8 |
9 /* | 9 /* |
10 * TODO: | 10 * TODO: |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 data = ctxt->userData; | 1418 data = ctxt->userData; |
1419 } | 1419 } |
1420 | 1420 |
1421 __xmlRaiseError(schannel, channel, data, | 1421 __xmlRaiseError(schannel, channel, data, |
1422 NULL, cur, XML_FROM_SCHEMATRONV, | 1422 NULL, cur, XML_FROM_SCHEMATRONV, |
1423 (test->type == XML_SCHEMATRON_ASSERT)?XML_SCHEMATRONV_AS
SERT:XML_SCHEMATRONV_REPORT, | 1423 (test->type == XML_SCHEMATRON_ASSERT)?XML_SCHEMATRONV_AS
SERT:XML_SCHEMATRONV_REPORT, |
1424 XML_ERR_ERROR, NULL, line, | 1424 XML_ERR_ERROR, NULL, line, |
1425 (pattern == NULL)?NULL:((const char *) pattern->name), | 1425 (pattern == NULL)?NULL:((const char *) pattern->name), |
1426 (const char *) path, | 1426 (const char *) path, |
1427 (const char *) report, 0, 0, | 1427 (const char *) report, 0, 0, |
1428 msg); | 1428 "%s", msg); |
1429 } else { | 1429 } else { |
1430 xmlSchematronReportOutput(ctxt, cur, &msg[0]); | 1430 xmlSchematronReportOutput(ctxt, cur, &msg[0]); |
1431 } | 1431 } |
1432 | 1432 |
1433 xmlFree((char *) report); | 1433 xmlFree((char *) report); |
1434 | 1434 |
1435 if ((path != NULL) && (path != (xmlChar *) cur->name)) | 1435 if ((path != NULL) && (path != (xmlChar *) cur->name)) |
1436 xmlFree(path); | 1436 xmlFree(path); |
1437 } | 1437 } |
1438 } | 1438 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 * we are just trying to assert the validity of the document, | 1684 * we are just trying to assert the validity of the document, |
1685 * speed primes over the output, run in a single pass | 1685 * speed primes over the output, run in a single pass |
1686 */ | 1686 */ |
1687 cur = root; | 1687 cur = root; |
1688 while (cur != NULL) { | 1688 while (cur != NULL) { |
1689 rule = ctxt->schema->rules; | 1689 rule = ctxt->schema->rules; |
1690 while (rule != NULL) { | 1690 while (rule != NULL) { |
1691 if (xmlPatternMatch(rule->pattern, cur) == 1) { | 1691 if (xmlPatternMatch(rule->pattern, cur) == 1) { |
1692 test = rule->tests; | 1692 test = rule->tests; |
1693 while (test != NULL) { | 1693 while (test != NULL) { |
1694 » » » xmlSchematronRunTest(ctxt, test, instance, cur, rule->pa
ttern); | 1694 » » » xmlSchematronRunTest(ctxt, test, instance, cur, (xmlSche
matronPatternPtr)rule->pattern); |
1695 test = test->next; | 1695 test = test->next; |
1696 } | 1696 } |
1697 } | 1697 } |
1698 rule = rule->next; | 1698 rule = rule->next; |
1699 } | 1699 } |
1700 | 1700 |
1701 cur = xmlSchematronNextNode(cur); | 1701 cur = xmlSchematronNextNode(cur); |
1702 } | 1702 } |
1703 } else { | 1703 } else { |
1704 /* | 1704 /* |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 | 1776 |
1777 xmlCleanupParser(); | 1777 xmlCleanupParser(); |
1778 xmlMemoryDump(); | 1778 xmlMemoryDump(); |
1779 | 1779 |
1780 return (0); | 1780 return (0); |
1781 } | 1781 } |
1782 #endif | 1782 #endif |
1783 #define bottom_schematron | 1783 #define bottom_schematron |
1784 #include "elfgcchack.h" | 1784 #include "elfgcchack.h" |
1785 #endif /* LIBXML_SCHEMATRON_ENABLED */ | 1785 #endif /* LIBXML_SCHEMATRON_ENABLED */ |
OLD | NEW |