mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
Add whitespace folding for some atomic data types that it's missing on.
XSD validation fails when some atomic types contain surrounding whitespace even though XML Schema Part 2: Datatypes Second Edition, section 4.3.6 says they should be collapsed. Fix this. (I am not sure whether the test is correct.) Issue: #278
This commit is contained in:
parent
e5cdb02d64
commit
966b0f21c1
@ -657,6 +657,7 @@ B EEF </value>
|
||||
</datatype>
|
||||
<datatype name="byte">
|
||||
<valid>1</valid>
|
||||
<valid> 1 </valid>
|
||||
<valid>127</valid>
|
||||
<valid>-128</valid>
|
||||
<invalid>128</invalid>
|
||||
@ -665,6 +666,7 @@ B EEF </value>
|
||||
<datatype name="unsignedLong">
|
||||
<valid>1</valid>
|
||||
<valid>+1</valid>
|
||||
<valid> 1 </valid>
|
||||
<invalid>-1</invalid>
|
||||
<valid>0</valid>
|
||||
<valid>18446744073709551615</valid>
|
||||
@ -674,6 +676,7 @@ B EEF </value>
|
||||
<datatype name="unsignedInt">
|
||||
<valid>1</valid>
|
||||
<valid>+1</valid>
|
||||
<valid> 1 </valid>
|
||||
<valid>0</valid>
|
||||
<valid>4294967295</valid>
|
||||
<invalid>4294967296</invalid>
|
||||
@ -682,6 +685,7 @@ B EEF </value>
|
||||
<datatype name="unsignedShort">
|
||||
<valid>1</valid>
|
||||
<valid>+1</valid>
|
||||
<valid> 1 </valid>
|
||||
<valid>0</valid>
|
||||
<valid>65535</valid>
|
||||
<invalid>65536</invalid>
|
||||
@ -689,6 +693,7 @@ B EEF </value>
|
||||
</datatype>
|
||||
<datatype name="unsignedByte">
|
||||
<valid>1</valid>
|
||||
<valid> 1 </valid>
|
||||
<valid>+1</valid>
|
||||
<valid>0</valid>
|
||||
<valid>255</valid>
|
||||
|
@ -3304,6 +3304,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
|
||||
if (cur == NULL)
|
||||
goto return1;
|
||||
if (normOnTheFly)
|
||||
while IS_WSP_BLANK_CH(*cur) cur++;
|
||||
if (*cur == '-') {
|
||||
sign = 1;
|
||||
cur++;
|
||||
@ -3312,6 +3314,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
ret = xmlSchemaParseUInt(&cur, &lo, &mi, &hi);
|
||||
if (ret < 0)
|
||||
goto return1;
|
||||
if (normOnTheFly)
|
||||
while IS_WSP_BLANK_CH(*cur) cur++;
|
||||
if (*cur != 0)
|
||||
goto return1;
|
||||
if (type->builtInType == XML_SCHEMAS_LONG) {
|
||||
@ -3376,9 +3380,13 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
|
||||
|
||||
if (cur == NULL)
|
||||
goto return1;
|
||||
if (normOnTheFly)
|
||||
while IS_WSP_BLANK_CH(*cur) cur++;
|
||||
ret = xmlSchemaParseUInt(&cur, &lo, &mi, &hi);
|
||||
if (ret < 0)
|
||||
goto return1;
|
||||
if (normOnTheFly)
|
||||
while IS_WSP_BLANK_CH(*cur) cur++;
|
||||
if (*cur != 0)
|
||||
goto return1;
|
||||
if (type->builtInType == XML_SCHEMAS_ULONG) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user