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 558551 - Regex support for pattern facet in RNG validation yields incorrect results
Regex support for pattern facet in RNG validation yields incorrect results
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: relaxng
2.6.31
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-30 15:19 UTC by Chuck Bearden
Modified: 2021-07-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Schema to exercise bug (1.58 KB, application/xml)
2008-10-30 15:22 UTC, Chuck Bearden
Details
Test instance (should be valid) (121 bytes, application/xml)
2008-10-30 15:23 UTC, Chuck Bearden
Details
Test instance (should be invalid) (150 bytes, application/xml)
2008-10-30 15:26 UTC, Chuck Bearden
Details
Test instance (should be invalid) (122 bytes, application/xml)
2008-10-30 15:27 UTC, Chuck Bearden
Details
Test instance (should be invalid) (127 bytes, application/xml)
2008-10-30 15:28 UTC, Chuck Bearden
Details
Test instance (should be valid) (153 bytes, application/xml)
2008-10-30 15:28 UTC, Chuck Bearden
Details
Test instance (should be valid) (158 bytes, application/xml)
2008-10-30 15:28 UTC, Chuck Bearden
Details
Test instance (should be valid) (130 bytes, application/xml)
2008-10-30 15:29 UTC, Chuck Bearden
Details

Description Chuck Bearden 2008-10-30 15:19:45 UTC
Please describe the problem:
When attribute content is defined with a regular expression by means of the data/@pattern facet, libxml2 does not always evaluate the attribute content correctly.  In particular, I am using regular expressions to ensure that an attribute contains a particular string either by itself or delimited from other strings by a space.


Steps to reproduce:
1. Using the attached schema and test XML instances, at a bash prompt:
$ for F in test0*.xml ; do xmllint --noout --relaxng regex.rng $F; done



Actual results:
test01.xml validates
test02.xml:6: element caption: Relax-NG validity error : Did not expect element caption there
test02.xml fails to validate
test03a.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test03a.xml fails to validate
test03b.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test03b.xml fails to validate
test04a.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test04a.xml:6: element caption: Relax-NG validity error : Did not expect element caption there
test04a.xml fails to validate
test04b.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test04b.xml:6: element caption: Relax-NG validity error : Did not expect element caption there
test04b.xml fails to validate
test05.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test05.xml fails to validate



Expected results:
test01.xml validates
test02.xml:6: element caption: Relax-NG validity error : Did not expect element caption there
test02.xml fails to validate
test03a.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test03a.xml fails to validate
test03b.xml:4: element code: Relax-NG validity error : Element code failed to validate attributes
test03b.xml fails to validate
test04a.xml validates
test04b.xml validates
test05.xml validates


Does this happen every time?
Yes.

Other information:
test01.xml	Should be valid (not of class 'listing' and no caption)
test02.xml	Should be invalid (not of class 'listing' but contains a caption)
test03a.xml	Should be invalid (class 'listing' but contains no caption)
test03b.xml	Variant on 3a: more than one token in @class
test04a.xml	Should be valid (class 'listing' and contains a caption)
test04b.xml	Variant on 4a: more than one token in @class
test05.xml	Should be valid (more than one token in @class, neither of them 'listing', and no caption)
Comment 1 Chuck Bearden 2008-10-30 15:22:52 UTC
Created attachment 121651 [details]
Schema to exercise bug
Comment 2 Chuck Bearden 2008-10-30 15:23:23 UTC
Created attachment 121652 [details]
Test instance (should be valid)
Comment 3 Chuck Bearden 2008-10-30 15:26:59 UTC
Created attachment 121653 [details]
Test instance (should be invalid)
Comment 4 Chuck Bearden 2008-10-30 15:27:20 UTC
Created attachment 121654 [details]
Test instance (should be invalid)
Comment 5 Chuck Bearden 2008-10-30 15:28:13 UTC
Created attachment 121655 [details]
Test instance (should be invalid)
Comment 6 Chuck Bearden 2008-10-30 15:28:31 UTC
Created attachment 121656 [details]
Test instance (should be valid)
Comment 7 Chuck Bearden 2008-10-30 15:28:50 UTC
Created attachment 121657 [details]
Test instance (should be valid)
Comment 8 Chuck Bearden 2008-10-30 15:29:07 UTC
Created attachment 121658 [details]
Test instance (should be valid)
Comment 9 GNOME Infrastructure Team 2021-07-05 13:23:04 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.