GNOME Bugzilla – Bug 307377
RELAX NG skips validating every other value in a list when using choice
Last modified: 2017-06-12 19:06:21 UTC
using the schema: <element name="number" xmlns="http://relaxng.org/ns/structure/1.0"> <attribute name="val"> <list> <oneOrMore> <choice> <value>1</value> <value>2</value> <value>3</value> </choice> </oneOrMore> </list> </attribute> <text/> </element> This document fails validation (correct): <number val="a 1 b 2 c 3" /> This document passes validation (wrong): <number val="1 a 2 b 3 c" /> In xmlRelaxNGValidateValue, the type XML_RELAXNG_CHOICE calls xmlRelaxNGValidateValue and type is XML_RELAXNG_VALUE. After validating it calls xmlRelaxNGNextValue. When call returns to the XML_RELAXNG_CHOICE block, xmlRelaxNGNextValue is called again, which skips the next value in the list.
Right the choice should not skip to next as the value checking call already did it ! Fix is in CVS, I also added the tests to the regression suite, thanks a lot, Daniel
This should be closed by release of libxml2-2.6.21, thanks, Daniel