From 01d8cf07d9136aa2ecb1e4925a239973cbc89285 Mon Sep 17 00:00:00 2001 From: bettermanzzy Date: Thu, 15 Aug 2019 15:15:42 +0800 Subject: [PATCH] Misleading error message with xs:{min|max}Inclusive Closes #53. --- result/schemas/decimal-2_1_0.err | 2 -- result/schemas/decimal-3_1_0.err | 4 ---- result/schemas/hexbinary_0_1.err | 3 --- result/schemas/restriction-enum-1_1_0.err | 1 - result/schemas/vdv-first4_0_2.err | 1 - xmlschemas.c | 2 +- 6 files changed, 1 insertion(+), 12 deletions(-) diff --git a/result/schemas/decimal-2_1_0.err b/result/schemas/decimal-2_1_0.err index fe663c26..bda17a54 100644 --- a/result/schemas/decimal-2_1_0.err +++ b/result/schemas/decimal-2_1_0.err @@ -1,4 +1,2 @@ ./test/schemas/decimal-2_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-0.1' is less than the minimum value allowed ('0'). -./test/schemas/decimal-2_0.xml:12: element val: Schemas validity error : Element 'val': '-0.1' is not a valid value of the atomic type 'myDecimal'. ./test/schemas/decimal-2_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-1' is less than the minimum value allowed ('0'). -./test/schemas/decimal-2_0.xml:13: element val: Schemas validity error : Element 'val': '-1' is not a valid value of the atomic type 'myDecimal'. diff --git a/result/schemas/decimal-3_1_0.err b/result/schemas/decimal-3_1_0.err index bba8cf98..f37a2009 100644 --- a/result/schemas/decimal-3_1_0.err +++ b/result/schemas/decimal-3_1_0.err @@ -1,8 +1,4 @@ ./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.123' has more digits than are allowed ('2'). -./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': '0.123' is not a valid value of the atomic type 'myDecimal'. ./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.023' has more digits than are allowed ('2'). -./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': '0.023' is not a valid value of the atomic type 'myDecimal'. ./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '123' has more digits than are allowed ('2'). -./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': '123' is not a valid value of the atomic type 'myDecimal'. ./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '12.3' has more digits than are allowed ('2'). -./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': '12.3' is not a valid value of the atomic type 'myDecimal'. diff --git a/result/schemas/hexbinary_0_1.err b/result/schemas/hexbinary_0_1.err index eb0c74ca..f43ef338 100644 --- a/result/schemas/hexbinary_0_1.err +++ b/result/schemas/hexbinary_0_1.err @@ -3,8 +3,5 @@ ./test/schemas/hexbinary_1.xml:8: element hex: Schemas validity error : Element 'hex': '+abcdef0123456789' is not a valid value of the atomic type 'xs:hexBinary'. ./test/schemas/hexbinary_1.xml:9: element hex: Schemas validity error : Element 'hex': '-0123456789abcdef' is not a valid value of the atomic type 'xs:hexBinary'. ./test/schemas/hexbinary_1.xml:11: element hex2: Schemas validity error : Element 'hex2': [facet 'maxLength'] The value has a length of '9'; this exceeds the allowed maximum length of '8'. -./test/schemas/hexbinary_1.xml:11: element hex2: Schemas validity error : Element 'hex2': '112233445566778899' is not a valid value of the local atomic type. ./test/schemas/hexbinary_1.xml:13: element hex3: Schemas validity error : Element 'hex3': [facet 'length'] The value has a length of '1'; this differs from the allowed length of '2'. -./test/schemas/hexbinary_1.xml:13: element hex3: Schemas validity error : Element 'hex3': 'ab' is not a valid value of the local atomic type. ./test/schemas/hexbinary_1.xml:14: element hex3: Schemas validity error : Element 'hex3': [facet 'length'] The value has a length of '3'; this differs from the allowed length of '2'. -./test/schemas/hexbinary_1.xml:14: element hex3: Schemas validity error : Element 'hex3': '00fedc' is not a valid value of the local atomic type. diff --git a/result/schemas/restriction-enum-1_1_0.err b/result/schemas/restriction-enum-1_1_0.err index 086d2deb..42dee61a 100644 --- a/result/schemas/restriction-enum-1_1_0.err +++ b/result/schemas/restriction-enum-1_1_0.err @@ -1,2 +1 @@ ./test/schemas/restriction-enum-1_0.xml:7: element foo: Schemas validity error : Element 'foo': [facet 'enumeration'] The value 'c' is not an element of the set {'a', 'b', 'd'}. -./test/schemas/restriction-enum-1_0.xml:7: element foo: Schemas validity error : Element 'foo': 'c' is not a valid value of the atomic type 'barType'. diff --git a/result/schemas/vdv-first4_0_2.err b/result/schemas/vdv-first4_0_2.err index 6c6e52fa..0a49faac 100644 --- a/result/schemas/vdv-first4_0_2.err +++ b/result/schemas/vdv-first4_0_2.err @@ -1,2 +1 @@ ./test/schemas/vdv-first4_2.xml:24: element born: Schemas validity error : Element 'born': [facet 'pattern'] The value '2000-01-20Z' is not accepted by the pattern '[^:Z]*'. -./test/schemas/vdv-first4_2.xml:24: element born: Schemas validity error : Element 'born': '2000-01-20Z' is not a valid value of the atomic type 'date'. diff --git a/xmlschemas.c b/xmlschemas.c index 019988aa..f3d2664b 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -24665,7 +24665,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; } } - if (fireErrors && (ret > 0)) + else if (fireErrors && (ret > 0)) xmlSchemaSimpleTypeErr(actxt, ret, node, value, type, 1); } else if (WXS_IS_LIST(type)) {