1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

give more infos fix a bug reported by Sebastian Rahtz and REF->DEF in

* check-xsddata-test-suite.py: give more infos
* relaxng.c: fix a bug reported by Sebastian Rahtz and
  REF->DEF in attribute values.
Daniel
This commit is contained in:
Daniel Veillard
2003-02-27 21:30:32 +00:00
parent eb7189ff35
commit 463a5479a8
3 changed files with 34 additions and 35 deletions

View File

@ -1,3 +1,9 @@
Thu Feb 27 22:28:40 CET 2003 Daniel Veillard <daniel@veillard.com>
* check-xsddata-test-suite.py: give more infos
* relaxng.c: fix a bug reported by Sebastian Rahtz and
REF->DEF in attribute values.
Thu Feb 27 21:09:32 CET 2003 Daniel Veillard <daniel@veillard.com> Thu Feb 27 21:09:32 CET 2003 Daniel Veillard <daniel@veillard.com>
* check-xsddata-test-suite.py test/xsdtest/xsdtest.xml * check-xsddata-test-suite.py test/xsdtest/xsdtest.xml

View File

@ -293,13 +293,12 @@ def handle_testCase(node):
def handle_testSuite(node, level = 0): def handle_testSuite(node, level = 0):
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
global nb_instances_tests, nb_instances_success, nb_instances_failed global nb_instances_tests, nb_instances_success, nb_instances_failed
if level >= 1: old_schemas_tests = nb_schemas_tests
old_schemas_tests = nb_schemas_tests old_schemas_success = nb_schemas_success
old_schemas_success = nb_schemas_success old_schemas_failed = nb_schemas_failed
old_schemas_failed = nb_schemas_failed old_instances_tests = nb_instances_tests
old_instances_tests = nb_instances_tests old_instances_success = nb_instances_success
old_instances_success = nb_instances_success old_instances_failed = nb_instances_failed
old_instances_failed = nb_instances_failed
docs = node.xpathEval('documentation') docs = node.xpathEval('documentation')
authors = node.xpathEval('author') authors = node.xpathEval('author')
@ -312,33 +311,22 @@ def handle_testSuite(node, level = 0):
for author in authors: for author in authors:
msg = msg + author.content + " " msg = msg + author.content + " "
print msg print msg
sections = node.xpathEval('section')
if sections != [] and level <= 0:
msg = ""
for section in sections:
msg = msg + section.content + " "
print "Tests for section %s" % (msg)
for test in node.xpathEval('testCase'): for test in node.xpathEval('testCase'):
handle_testCase(test) handle_testCase(test)
for test in node.xpathEval('testSuite'): for test in node.xpathEval('testSuite'):
handle_testSuite(test, level + 1) handle_testSuite(test, level + 1)
print "Result of tests for %s" % (node.xpathEval('string(documentation)'))
if level >= 1 and sections != []: if nb_schemas_tests != old_schemas_tests:
msg = "" print "found %d test schemas: %d success %d failures" % (
for section in sections: nb_schemas_tests - old_schemas_tests,
msg = msg + section.content + " " nb_schemas_success - old_schemas_success,
print "Result of tests for section %s" % (msg) nb_schemas_failed - old_schemas_failed)
if nb_schemas_tests != old_schemas_tests: if nb_instances_tests != old_instances_tests:
print "found %d test schemas: %d success %d failures" % ( print "found %d test instances: %d success %d failures" % (
nb_schemas_tests - old_schemas_tests, nb_instances_tests - old_instances_tests,
nb_schemas_success - old_schemas_success, nb_instances_success - old_instances_success,
nb_schemas_failed - old_schemas_failed) nb_instances_failed - old_instances_failed)
if nb_instances_tests != old_instances_tests:
print "found %d test instances: %d success %d failures" % (
nb_instances_tests - old_instances_tests,
nb_instances_success - old_instances_success,
nb_instances_failed - old_instances_failed)
# #
# Parse the conf file # Parse the conf file
# #

View File

@ -4370,12 +4370,6 @@ xmlRelaxNGCheckRules(xmlRelaxNGParserCtxtPtr ctxt,
"Found forbidden pattern list//ref\n"); "Found forbidden pattern list//ref\n");
ctxt->nbErrors++; ctxt->nbErrors++;
} }
if (flags & XML_RELAXNG_IN_ATTRIBUTE) {
if (ctxt->error != NULL)
ctxt->error(ctxt->userData,
"Found forbidden pattern attribute//ref\n");
ctxt->nbErrors++;
}
if (flags & XML_RELAXNG_IN_DATAEXCEPT) { if (flags & XML_RELAXNG_IN_DATAEXCEPT) {
if (ctxt->error != NULL) if (ctxt->error != NULL)
ctxt->error(ctxt->userData, ctxt->error(ctxt->userData,
@ -4415,6 +4409,12 @@ xmlRelaxNGCheckRules(xmlRelaxNGParserCtxtPtr ctxt,
"Found forbidden pattern attribute//element(ref)\n"); "Found forbidden pattern attribute//element(ref)\n");
ctxt->nbErrors++; ctxt->nbErrors++;
} }
if (flags & XML_RELAXNG_IN_ATTRIBUTE) {
if (ctxt->error != NULL)
ctxt->error(ctxt->userData,
"Found forbidden pattern attribute//element(ref)\n");
ctxt->nbErrors++;
}
/* /*
* reset since in the simple form elements are only child * reset since in the simple form elements are only child
* of grammar/define * of grammar/define
@ -6258,6 +6258,7 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
} }
break; break;
} }
case XML_RELAXNG_DEF:
case XML_RELAXNG_GROUP: { case XML_RELAXNG_GROUP: {
xmlRelaxNGDefinePtr list; xmlRelaxNGDefinePtr list;
@ -6273,6 +6274,10 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
} }
break; break;
} }
case XML_RELAXNG_REF:
case XML_RELAXNG_PARENTREF:
ret = xmlRelaxNGValidateValue(ctxt, define->content);
break;
default: default:
TODO TODO
ret = -1; ret = -1;