Commit ea695ac0 authored by Jan Pokorný's avatar Jan Pokorný Committed by Nick Wellnhofer

Fix unability to RelaxNG-validate grammar with choice-based name class

Previously, test/relaxng/ambig_name-class2.xml would fail to validate
against test/relaxng/ambig_name-class2.rng:

> test/relaxng/ambig_name-class2.rng:4:
>   element attribute: Relax-NG parser error :
>       Found anyName attribute without oneOrMore ancestor
> Relax-NG schema test/relaxng/ambig_name-class2.rng failed to compile
Signed-off-by: default avatarJan Pokorný <jpokorny@redhat.com>
parent 8074b881
......@@ -6395,7 +6395,10 @@ xmlRelaxNGCheckRules(xmlRelaxNGParserCtxtPtr ctxt,
NULL, NULL);
}
if ((!(flags & XML_RELAXNG_IN_ONEORMORE))
&& (cur->name == NULL)) {
&& cur->name == NULL
/* following is checking alternative name class readiness
in case it went the "choice" route */
&& cur->nameClass == NULL) {
if (cur->ns == NULL) {
xmlRngPErr(ctxt, cur->node, XML_RNGP_ANYNAME_ATTR_ANCESTOR,
"Found anyName attribute without oneOrMore ancestor\n",
......
./test/relaxng/ambig_name-class2.rng validates
ambig_name-class.xml
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment