After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 307377 - RELAX NG skips validating every other value in a list when using choice
RELAX NG skips validating every other value in a list when using choice
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: relaxng
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-12 13:39 UTC by Rob Richards
Modified: 2017-06-12 19:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Rob Richards 2005-06-12 13:39:23 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.
Comment 1 Daniel Veillard 2005-08-10 16:24:32 UTC
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
Comment 2 Daniel Veillard 2005-09-05 08:59:19 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel