mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2026-01-26 21:41:34 +03:00
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: Jan Pokorný <jpokorny@redhat.com>
This commit is contained in:
committed by
Nick Wellnhofer
parent
8074b88179
commit
ea695ac0d6
@@ -6395,7 +6395,10 @@ xmlRelaxNGCheckRules(xmlRelaxNGParserCtxtPtr ctxt,
|
|||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
}
|
}
|
||||||
if ((!(flags & XML_RELAXNG_IN_ONEORMORE))
|
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) {
|
if (cur->ns == NULL) {
|
||||||
xmlRngPErr(ctxt, cur->node, XML_RNGP_ANYNAME_ATTR_ANCESTOR,
|
xmlRngPErr(ctxt, cur->node, XML_RNGP_ANYNAME_ATTR_ANCESTOR,
|
||||||
"Found anyName attribute without oneOrMore ancestor\n",
|
"Found anyName attribute without oneOrMore ancestor\n",
|
||||||
|
|||||||
1
result/relaxng/ambig_name-class2_err
Normal file
1
result/relaxng/ambig_name-class2_err
Normal file
@@ -0,0 +1 @@
|
|||||||
|
./test/relaxng/ambig_name-class2.rng validates
|
||||||
0
result/relaxng/ambig_name-class2_valid
Normal file
0
result/relaxng/ambig_name-class2_valid
Normal file
1
test/relaxng/ambig_name-class2.rng
Symbolic link
1
test/relaxng/ambig_name-class2.rng
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
ambig_name-class.xml
|
||||||
1
test/relaxng/ambig_name-class2.xml
Normal file
1
test/relaxng/ambig_name-class2.xml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<foo alpha="all"/>
|
||||||
Reference in New Issue
Block a user