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 726766 - libxml2 not ignoring whitespace when validating xsd:int
libxml2 not ignoring whitespace when validating xsd:int
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
git master
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-20 08:42 UTC by Markus Schöpflin
Modified: 2021-07-05 13:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Markus Schöpflin 2014-03-20 08:42:48 UTC
Versions tested and affected: 2.9.1-2 (FC), 2.7.6-14 (CentOS)

Given the following schema:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="a" type="xsd:int"/>
</xsd:schema>

And the following document:

<a> 42</a>

Xmllint fails to validate this:

$ xmllint --schema test_schema.xml test_doc.xml 
<?xml version="1.0"?>
<a> 42</a>
test_doc.xml:1: element a: Schemas validity error : Element 'a': ' 42' is not a valid value of the atomic type 'xs:int'.
test_doc.xml fails to validate
Comment 1 Markus Schöpflin 2014-03-20 08:44:03 UTC
According to XML Schema Part 2: Datatypes Second Edition, section 4.3.6 all atomic data types other than 'string' have their 'whiteSpace' constraint set to 'collapse', so I think the element 'a' should be valid.

There is even a comment to this effect in the libxml2 sources (xmlschemas.c / xmlSchemaTypeFixupWhitespace()): 

/* 
 * For all `atomic` datatypes other than string (and types `derived` 
 * by `restriction` from it) the value of whiteSpace is fixed to 
 * collapse 
 */
Comment 2 Jos de Kloe 2016-12-12 11:16:23 UTC
I am getting the same error for version: libxml2-2.9.3-3.fc24.x86_64

this is also my vote to give this one a little more priority ...
Comment 3 GNOME Infrastructure Team 2021-07-05 13:26:54 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.