diff options
author | Kasimier T. Buchcik <kbuchcik@src.gnome.org> | 2004-11-17 13:14:27 +0000 |
---|---|---|
committer | Kasimier T. Buchcik <kbuchcik@src.gnome.org> | 2004-11-17 13:14:27 +0000 |
commit | 8b41817d5858297626217e2a6cc0cc176cbfb211 (patch) | |
tree | 907d60692b0b313a806190742b4a0faa5683ba49 | |
parent | b884124c34c5ed35f51108092a16801ad2a671ad (diff) | |
download | libxml2-8b41817d5858297626217e2a6cc0cc176cbfb211.tar.gz |
tiny enhancement for content model error reports (#157190, #143948).
* xmlschemas.c: tiny enhancement for content model error reports (#157190, #143948).
Removed abbreviations: CT, ST and WC (#157190, reported by Frans Englich).
Initial: no report of local components.
* result/schemas/all* result/schemas/any3_0_0.err result/schemas/choice*
result/schemas/cos-st-restricts-1-2-err_0_0.err result/schemas/derivation-ok-extension-err_0_0.err
result/schemas/derivation-ok-extension_0_0.err result/schemas/derivation-ok-restriction-2-1-1_0_0.err
result/schemas/derivation-ok-restriction-4-1-err_0_0.err result/schemas/deter0_0_0.err
result/schemas/extension1_0_2.err result/schemas/facet-unionST-err1_0_0.err
result/schemas/hexbinary_0_1.err result/schemas/list* result/schemas/restriction-attr1_0_0.err
result/schemas/vdv-first4_0_1.err result/schemas/vdv-first4_0_2.err: Adapted output.
40 files changed, 144 insertions, 76 deletions
@@ -1,3 +1,16 @@ +Wed Nov 17 13:54:37 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> + + * xmlschemas.c: tiny enhancement for content model error reports (#157190, #143948). + Removed abbreviations: CT, ST and WC (#157190, reported by Frans Englich). + Initial: no report of local components. + * result/schemas/all* result/schemas/any3_0_0.err result/schemas/choice* + result/schemas/cos-st-restricts-1-2-err_0_0.err result/schemas/derivation-ok-extension-err_0_0.err + result/schemas/derivation-ok-extension_0_0.err result/schemas/derivation-ok-restriction-2-1-1_0_0.err + result/schemas/derivation-ok-restriction-4-1-err_0_0.err result/schemas/deter0_0_0.err + result/schemas/extension1_0_2.err result/schemas/facet-unionST-err1_0_0.err + result/schemas/hexbinary_0_1.err result/schemas/list* result/schemas/restriction-attr1_0_0.err + result/schemas/vdv-first4_0_1.err result/schemas/vdv-first4_0_2.err: Adapted output. + Mon Nov 15 13:04:28 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net> * xmlschemas.c: Moved execution of xmlSchemaCheckDefaults to diff --git a/result/schemas/all_0_3.err b/result/schemas/all_0_3.err index cac6c186..c8921525 100644 --- a/result/schemas/all_0_3.err +++ b/result/schemas/all_0_3.err @@ -1 +1 @@ -./test/schemas/all_3.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_3.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/all_0_4.err b/result/schemas/all_0_4.err index 6774c04a..16ef953b 100644 --- a/result/schemas/all_0_4.err +++ b/result/schemas/all_0_4.err @@ -1 +1 @@ -./test/schemas/all_4.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/all_0_5.err b/result/schemas/all_0_5.err index 19152d4b..e859ebd2 100644 --- a/result/schemas/all_0_5.err +++ b/result/schemas/all_0_5.err @@ -1 +1 @@ -./test/schemas/all_5.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_5.xml:1: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/all_0_6.err b/result/schemas/all_0_6.err index 70eee9fb..1db66b29 100644 --- a/result/schemas/all_0_6.err +++ b/result/schemas/all_0_6.err @@ -1 +1 @@ -./test/schemas/all_6.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_6.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/all_0_7.err b/result/schemas/all_0_7.err index 0fe325d7..5061ff4f 100644 --- a/result/schemas/all_0_7.err +++ b/result/schemas/all_0_7.err @@ -1 +1 @@ -./test/schemas/all_7.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_7.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/all_1_5.err b/result/schemas/all_1_5.err index 19152d4b..e859ebd2 100644 --- a/result/schemas/all_1_5.err +++ b/result/schemas/all_1_5.err @@ -1 +1 @@ -./test/schemas/all_5.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_5.xml:1: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/all_2_0.err b/result/schemas/all_2_0.err index c7e94499..6ef8590b 100644 --- a/result/schemas/all_2_0.err +++ b/result/schemas/all_2_0.err @@ -1 +1 @@ -./test/schemas/all_0.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_0.xml:1: element c: Schemas validity error : Element 'c': This element is not expected. diff --git a/result/schemas/all_2_1.err b/result/schemas/all_2_1.err index 944ab08a..f5162cf3 100644 --- a/result/schemas/all_2_1.err +++ b/result/schemas/all_2_1.err @@ -1 +1,2 @@ -./test/schemas/all_1.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_1.xml:1: element c: Schemas validity error : Element 'c': This element is not expected. +./test/schemas/all_1.xml:1: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/all_2_2.err b/result/schemas/all_2_2.err index 22d4e6f3..1f044620 100644 --- a/result/schemas/all_2_2.err +++ b/result/schemas/all_2_2.err @@ -1 +1 @@ -./test/schemas/all_2.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_2.xml:1: element c: Schemas validity error : Element 'c': This element is not expected. diff --git a/result/schemas/all_2_4.err b/result/schemas/all_2_4.err index 6774c04a..16ef953b 100644 --- a/result/schemas/all_2_4.err +++ b/result/schemas/all_2_4.err @@ -1 +1 @@ -./test/schemas/all_4.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/all_2_5.err b/result/schemas/all_2_5.err index 19152d4b..e859ebd2 100644 --- a/result/schemas/all_2_5.err +++ b/result/schemas/all_2_5.err @@ -1 +1 @@ -./test/schemas/all_5.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/all_5.xml:1: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/any3_0_0.err b/result/schemas/any3_0_0.err index 1b8b8f67..c5c9500d 100644 --- a/result/schemas/any3_0_0.err +++ b/result/schemas/any3_0_0.err @@ -1 +1,3 @@ -./test/schemas/any3_0.xml:10: element foo: Schemas validity error : Element 'foo:foo' [CT local]: The element content is not valid. +./test/schemas/any3_0.xml:12: element bar.A: Schemas validity error : Element 'bar.A': This element is not expected. +./test/schemas/any3_0.xml:13: element bar.B: Schemas validity error : Element 'foo:bar.B': This element is not expected. +./test/schemas/any3_0.xml:14: element bar.C: Schemas validity error : Element 'bar:bar.C': This element is not expected. diff --git a/result/schemas/choice_0_2.err b/result/schemas/choice_0_2.err index 0f0dc595..51414458 100644 --- a/result/schemas/choice_0_2.err +++ b/result/schemas/choice_0_2.err @@ -1 +1 @@ -./test/schemas/choice_2.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_2.xml:3: element b: Schemas validity error : Element 'b': This element is not expected. diff --git a/result/schemas/choice_0_3.err b/result/schemas/choice_0_3.err index 95089b35..ece5d69f 100644 --- a/result/schemas/choice_0_3.err +++ b/result/schemas/choice_0_3.err @@ -1 +1 @@ -./test/schemas/choice_3.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_3.xml:3: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/choice_0_4.err b/result/schemas/choice_0_4.err index bd30cc76..58da5d97 100644 --- a/result/schemas/choice_0_4.err +++ b/result/schemas/choice_0_4.err @@ -1 +1 @@ -./test/schemas/choice_4.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/choice_0_5.err b/result/schemas/choice_0_5.err index b6ec45bf..8e908088 100644 --- a/result/schemas/choice_0_5.err +++ b/result/schemas/choice_0_5.err @@ -1 +1,2 @@ -./test/schemas/choice_5.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_5.xml:3: element b: Schemas validity error : Element 'b': This element is not expected. +./test/schemas/choice_5.xml:4: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/choice_0_6.err b/result/schemas/choice_0_6.err index b83b4601..dc0051d0 100644 --- a/result/schemas/choice_0_6.err +++ b/result/schemas/choice_0_6.err @@ -1 +1,3 @@ -./test/schemas/choice_6.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_6.xml:3: element b: Schemas validity error : Element 'b': This element is not expected. +./test/schemas/choice_6.xml:4: element a: Schemas validity error : Element 'a': This element is not expected. +./test/schemas/choice_6.xml:5: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/choice_1_2.err b/result/schemas/choice_1_2.err index 0f0dc595..51414458 100644 --- a/result/schemas/choice_1_2.err +++ b/result/schemas/choice_1_2.err @@ -1 +1 @@ -./test/schemas/choice_2.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_2.xml:3: element b: Schemas validity error : Element 'b': This element is not expected. diff --git a/result/schemas/choice_1_3.err b/result/schemas/choice_1_3.err index 95089b35..ece5d69f 100644 --- a/result/schemas/choice_1_3.err +++ b/result/schemas/choice_1_3.err @@ -1 +1 @@ -./test/schemas/choice_3.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_3.xml:3: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/choice_1_5.err b/result/schemas/choice_1_5.err index b6ec45bf..8e908088 100644 --- a/result/schemas/choice_1_5.err +++ b/result/schemas/choice_1_5.err @@ -1 +1,2 @@ -./test/schemas/choice_5.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_5.xml:3: element b: Schemas validity error : Element 'b': This element is not expected. +./test/schemas/choice_5.xml:4: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/choice_1_6.err b/result/schemas/choice_1_6.err index b83b4601..dc0051d0 100644 --- a/result/schemas/choice_1_6.err +++ b/result/schemas/choice_1_6.err @@ -1 +1,3 @@ -./test/schemas/choice_6.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_6.xml:3: element b: Schemas validity error : Element 'b': This element is not expected. +./test/schemas/choice_6.xml:4: element a: Schemas validity error : Element 'a': This element is not expected. +./test/schemas/choice_6.xml:5: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/choice_2_4.err b/result/schemas/choice_2_4.err index bd30cc76..58da5d97 100644 --- a/result/schemas/choice_2_4.err +++ b/result/schemas/choice_2_4.err @@ -1 +1 @@ -./test/schemas/choice_4.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). diff --git a/result/schemas/choice_2_6.err b/result/schemas/choice_2_6.err index b83b4601..bef56da0 100644 --- a/result/schemas/choice_2_6.err +++ b/result/schemas/choice_2_6.err @@ -1 +1 @@ -./test/schemas/choice_6.xml:1: element doc: Schemas validity error : Element 'doc' [CT local]: The element content is not valid. +./test/schemas/choice_6.xml:5: element a: Schemas validity error : Element 'a': This element is not expected. diff --git a/result/schemas/cos-st-restricts-1-2-err_0_0.err b/result/schemas/cos-st-restricts-1-2-err_0_0.err index 88288d17..e180b637 100644 --- a/result/schemas/cos-st-restricts-1-2-err_0_0.err +++ b/result/schemas/cos-st-restricts-1-2-err_0_0.err @@ -1 +1 @@ -./test/schemas/cos-st-restricts-1-2-err_0.xml:3: element foo: Schemas validity error : Element 'foo' [ST 'type.A', facet 'length']: The value has a length of '2'; this differs from the allowed length of '3'. +./test/schemas/cos-st-restricts-1-2-err_0.xml:3: element foo: Schemas validity error : Element 'foo' [simple type 'type.A', facet 'length']: The value has a length of '2'; this differs from the allowed length of '3'. diff --git a/result/schemas/derivation-ok-extension-err_0_0.err b/result/schemas/derivation-ok-extension-err_0_0.err index 15b4ae08..6c2b7b6e 100644 --- a/result/schemas/derivation-ok-extension-err_0_0.err +++ b/result/schemas/derivation-ok-extension-err_0_0.err @@ -1 +1 @@ -./test/schemas/derivation-ok-extension-err_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barA_1'}: Duplicate attribute use specified. +./test/schemas/derivation-ok-extension-err_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barA_1'}: Duplicate attribute use specified. diff --git a/result/schemas/derivation-ok-extension_0_0.err b/result/schemas/derivation-ok-extension_0_0.err index 0c58ab50..310d85be 100644 --- a/result/schemas/derivation-ok-extension_0_0.err +++ b/result/schemas/derivation-ok-extension_0_0.err @@ -1 +1 @@ -./test/schemas/derivation-ok-extension_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barA_1'}: Duplicate attribute use specified. +./test/schemas/derivation-ok-extension_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barA_1'}: Duplicate attribute use specified. diff --git a/result/schemas/derivation-ok-restriction-2-1-1_0_0.err b/result/schemas/derivation-ok-restriction-2-1-1_0_0.err index 4a69cd0e..cb85195d 100644 --- a/result/schemas/derivation-ok-restriction-2-1-1_0_0.err +++ b/result/schemas/derivation-ok-restriction-2-1-1_0_0.err @@ -1,6 +1,6 @@ -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barB_1'}: The 'optional' use is inconsistent with a matching 'required' use of the base type. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : CT local: A matching attribute use for the 'required' attribute use {'barB_3'} of the base type is missing. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barC_1'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barC_2'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barD_1'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. -./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : CT local, attr. use {'barD_2'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barB_1'}: The 'optional' use is inconsistent with a matching 'required' use of the base type. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : complex type: A matching attribute use for the 'required' attribute use {'barB_3'} of the base type is missing. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barC_1'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barC_2'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barD_1'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. +./test/schemas/derivation-ok-restriction-2-1-1_0.xsd:6: element complexType: Schemas parser error : complex type, attr. use {'barD_2'}: Neither a matching attribute use, nor a matching wildcard in the base type does exist. diff --git a/result/schemas/derivation-ok-restriction-4-1-err_0_0.err b/result/schemas/derivation-ok-restriction-4-1-err_0_0.err index 27ff3b85..8cacb071 100644 --- a/result/schemas/derivation-ok-restriction-4-1-err_0_0.err +++ b/result/schemas/derivation-ok-restriction-4-1-err_0_0.err @@ -1,3 +1,3 @@ -./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:33: element complexType: Schemas parser error : CT 'type.A': The type has an attribute wildcard, but the base type CT 'base.type.A' does not have one. -./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:45: element complexType: Schemas parser error : CT 'type.B': The attribute wildcard is not a valid subset of the wildcard in the base type CT 'base.type.B'. -./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:57: element complexType: Schemas parser error : CT 'type.C': The 'process contents' of the attribute wildcard is weaker than the one in the base type CT 'base.type.C'. +./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:33: element complexType: Schemas parser error : complex type 'type.A': The type has an attribute wildcard, but the base type complex type 'base.type.A' does not have one. +./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:45: element complexType: Schemas parser error : complex type 'type.B': The attribute wildcard is not a valid subset of the wildcard in the base type complex type 'base.type.B'. +./test/schemas/derivation-ok-restriction-4-1-err_0.xsd:57: element complexType: Schemas parser error : complex type 'type.C': The 'process contents' of the attribute wildcard is weaker than the one in the base type complex type 'base.type.C'. diff --git a/result/schemas/deter0_0_0.err b/result/schemas/deter0_0_0.err index 73d2532b..8407b3d6 100644 --- a/result/schemas/deter0_0_0.err +++ b/result/schemas/deter0_0_0.err @@ -1 +1 @@ -./test/schemas/deter0_0.xsd:6: element complexType: Schemas parser error : CT local: The content model is not determinist. +./test/schemas/deter0_0.xsd:6: element complexType: Schemas parser error : complex type: The content model is not determinist. diff --git a/result/schemas/extension1_0_2.err b/result/schemas/extension1_0_2.err index 3952e5b2..3156a447 100644 --- a/result/schemas/extension1_0_2.err +++ b/result/schemas/extension1_0_2.err @@ -1 +1 @@ -./test/schemas/extension1_2.xml:1: element title: Schemas validity error : Element 'title' [CT local]: Element content is not allowed, because the content type is a simple type. +./test/schemas/extension1_2.xml:1: element title: Schemas validity error : Element 'title': Element content is not allowed, because the content type is a simple type. diff --git a/result/schemas/facet-unionST-err1_0_0.err b/result/schemas/facet-unionST-err1_0_0.err index 5b42f732..26db4a51 100644 --- a/result/schemas/facet-unionST-err1_0_0.err +++ b/result/schemas/facet-unionST-err1_0_0.err @@ -1 +1 @@ -./test/schemas/facet-unionST-err1_0.xml:3: element foo: Schemas validity error : Element 'foo' [ST 'fooType.B']: The character content is not valid. +./test/schemas/facet-unionST-err1_0.xml:3: element foo: Schemas validity error : Element 'foo' [simple type 'fooType.B']: The character content is not valid. diff --git a/result/schemas/hexbinary_0_1.err b/result/schemas/hexbinary_0_1.err index e483c914..7a263c79 100644 --- a/result/schemas/hexbinary_0_1.err +++ b/result/schemas/hexbinary_0_1.err @@ -2,6 +2,6 @@ ./test/schemas/hexbinary_1.xml:7: element hex: Schemas validity error : Element 'hex' ['hexBinary']: The character content is not valid. ./test/schemas/hexbinary_1.xml:8: element hex: Schemas validity error : Element 'hex' ['hexBinary']: The character content is not valid. ./test/schemas/hexbinary_1.xml:9: element hex: Schemas validity error : Element 'hex' ['hexBinary']: The character content is not valid. -./test/schemas/hexbinary_1.xml:11: element hex2: Schemas validity error : Element 'hex2' [ST local, facet 'maxLength']: The value has a length of '9'; this exceeds the allowed maximum length of '8'. -./test/schemas/hexbinary_1.xml:13: element hex3: Schemas validity error : Element 'hex3' [ST local, facet 'length']: The value has a length of '1'; this differs from the allowed length of '2'. -./test/schemas/hexbinary_1.xml:14: element hex3: Schemas validity error : Element 'hex3' [ST local, facet 'length']: The value has a length of '3'; this differs from the allowed length of '2'. +./test/schemas/hexbinary_1.xml:11: element hex2: Schemas validity error : Element 'hex2' [simple type, facet 'maxLength']: The value has a length of '9'; this exceeds the allowed maximum length of '8'. +./test/schemas/hexbinary_1.xml:13: element hex3: Schemas validity error : Element 'hex3' [simple type, facet 'length']: The value has a length of '1'; this differs from the allowed length of '2'. +./test/schemas/hexbinary_1.xml:14: element hex3: Schemas validity error : Element 'hex3' [simple type, facet 'length']: The value has a length of '3'; this differs from the allowed length of '2'. diff --git a/result/schemas/list0_0_1.err b/result/schemas/list0_0_1.err index 0fa52687..56e255e6 100644 --- a/result/schemas/list0_0_1.err +++ b/result/schemas/list0_0_1.err @@ -1 +1 @@ -./test/schemas/list0_1.xml:1: element test: Schemas validity error : Element 'test' [CT local]: The element content is not valid. +./test/schemas/list0_1.xml:1: element test: Schemas validity error : Element 'test': Missing child element(s). diff --git a/result/schemas/list0_1_0.err b/result/schemas/list0_1_0.err index de7b589c..0bc3c8a5 100644 --- a/result/schemas/list0_1_0.err +++ b/result/schemas/list0_1_0.err @@ -1 +1 @@ -./test/schemas/list0_0.xml:1: element test: Schemas validity error : Element 'test' [CT local]: The element content is not valid. +./test/schemas/list0_0.xml:5: element string: Schemas validity error : Element 'string': This element is not expected. diff --git a/result/schemas/list0_1_1.err b/result/schemas/list0_1_1.err index 0fa52687..56e255e6 100644 --- a/result/schemas/list0_1_1.err +++ b/result/schemas/list0_1_1.err @@ -1 +1 @@ -./test/schemas/list0_1.xml:1: element test: Schemas validity error : Element 'test' [CT local]: The element content is not valid. +./test/schemas/list0_1.xml:1: element test: Schemas validity error : Element 'test': Missing child element(s). diff --git a/result/schemas/restriction-attr1_0_0.err b/result/schemas/restriction-attr1_0_0.err index 8214d73e..2403fc44 100644 --- a/result/schemas/restriction-attr1_0_0.err +++ b/result/schemas/restriction-attr1_0_0.err @@ -1 +1 @@ -./test/schemas/restriction-attr1_0.xsd:5: element complexType: Schemas parser error : CT local, attr. use {'barA'}: The 'optional' use is inconsistent with a matching 'required' use of the base type. +./test/schemas/restriction-attr1_0.xsd:5: element complexType: Schemas parser error : complex type, attr. use {'barA'}: The 'optional' use is inconsistent with a matching 'required' use of the base type. diff --git a/result/schemas/vdv-first4_0_1.err b/result/schemas/vdv-first4_0_1.err index 3edb1399..522ab40b 100644 --- a/result/schemas/vdv-first4_0_1.err +++ b/result/schemas/vdv-first4_0_1.err @@ -1 +1 @@ -./test/schemas/vdv-first4_1.xml:14: element born: Schemas validity error : Element 'born' [ST 'date']: The character content is not valid. +./test/schemas/vdv-first4_1.xml:14: element born: Schemas validity error : Element 'born' [simple type 'date']: The character content is not valid. diff --git a/result/schemas/vdv-first4_0_2.err b/result/schemas/vdv-first4_0_2.err index 3930e7e6..f502cacd 100644 --- a/result/schemas/vdv-first4_0_2.err +++ b/result/schemas/vdv-first4_0_2.err @@ -1 +1 @@ -./test/schemas/vdv-first4_2.xml:24: element born: Schemas validity error : Element 'born' [ST 'date', 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' [simple type 'date', facet 'pattern']: The value '2000-01-20Z' is not accepted by the pattern '[^:Z]*'. diff --git a/xmlschemas.c b/xmlschemas.c index b664c9bf..0803ebcb 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -76,9 +76,9 @@ static const xmlChar *xmlSchemaElemDesAttrDecl = (const xmlChar *) static const xmlChar *xmlSchemaElemDesAttrRef = (const xmlChar *) "Attribute ref."; static const xmlChar *xmlSchemaElemDesST = (const xmlChar *) - "ST"; + "simple type"; static const xmlChar *xmlSchemaElemDesCT = (const xmlChar *) - "CT"; + "complex type"; #define IS_SCHEMA(node, type) \ ((node != NULL) && (node->ns != NULL) && \ @@ -764,7 +764,9 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrcat(*buf, BAD_CAST "'"); } else { *buf = xmlStrdup(xmlSchemaElemDesST); - *buf = xmlStrcat(*buf, BAD_CAST " local"); + /* Local types will get to name + *buf = xmlStrcat(*buf, BAD_CAST " "); + */ } } else if (item->type == XML_SCHEMA_TYPE_COMPLEX) { if (item->flags & XML_SCHEMAS_TYPE_GLOBAL) { @@ -774,7 +776,9 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrcat(*buf, BAD_CAST "'"); } else { *buf = xmlStrdup(xmlSchemaElemDesCT); - *buf = xmlStrcat(*buf, BAD_CAST " local"); + /* Local types will get to name + *buf = xmlStrcat(*buf, BAD_CAST " "); + */ } } else if (item->type == XML_SCHEMA_TYPE_ATTRIBUTE) { xmlSchemaAttributePtr attr; @@ -1068,7 +1072,8 @@ xmlSchemaVComplexTypeErr(xmlSchemaValidCtxtPtr ctxt, xmlChar *str = NULL, *msg = NULL; xmlSchemaFormatItemForReport(&msg, NULL, NULL, node, 0); - if (type != NULL) { + /* Specify the complex type only if it is global. */ + if ((type != NULL) && (type->flags & XML_SCHEMAS_TYPE_GLOBAL)) { msg = xmlStrcat(msg, BAD_CAST " ["); msg = xmlStrcat(msg, xmlSchemaFormatItemForReport(&str, NULL, type, NULL, 0)); msg = xmlStrcat(msg, BAD_CAST "]"); @@ -1647,6 +1652,34 @@ xmlSchemaVIllegalAttrErr(xmlSchemaValidCtxtPtr ctxt, FREE_AND_NULL(strA) } + +static int +xmlSchemaIsGlobalItem(xmlSchemaTypePtr item) +{ + switch (item->type) { + case XML_SCHEMA_TYPE_COMPLEX: + case XML_SCHEMA_TYPE_SIMPLE: + case XML_SCHEMA_TYPE_GROUP: + if (item->flags & XML_SCHEMAS_TYPE_GLOBAL) + return(1); + break; + case XML_SCHEMA_TYPE_ELEMENT: + if ( ((xmlSchemaElementPtr) item)->flags & + XML_SCHEMAS_ELEM_GLOBAL) + return(1); + break; + case XML_SCHEMA_TYPE_ATTRIBUTE: + if ( ((xmlSchemaAttributePtr) item)->flags & + XML_SCHEMAS_ATTR_GLOBAL) + return(1); + break; + /* Note that attribute groups are always global. */ + default: + return(1); + } + return (0); +} + /** * xmlSchemaVCustomErr: * @ctxt: the schema validation context @@ -1678,7 +1711,7 @@ xmlSchemaVCustomErr(xmlSchemaValidCtxtPtr ctxt, /* TODO: Are the HTML and DOCB doc nodes expected here? */ if (node->type != XML_DOCUMENT_NODE) { xmlSchemaFormatItemForReport(&msg, NULL, NULL, node, 0); - if (type != NULL) { + if ((type != NULL) && (xmlSchemaIsGlobalItem(type))) { msg = xmlStrcat(msg, BAD_CAST " ["); msg = xmlStrcat(msg, xmlSchemaFormatItemForReport(&str, NULL, type, NULL, 0)); msg = xmlStrcat(msg, BAD_CAST "]"); @@ -1737,7 +1770,7 @@ xmlSchemaVWildcardErr(xmlSchemaValidCtxtPtr ctxt, xmlSchemaFormatItemForReport(&des, NULL, NULL, node, 0); msg = xmlStrdup(BAD_CAST "%s, ["); msg = xmlStrcat(msg, BAD_CAST xmlSchemaWildcardPCToString(wild->processContents)); - msg = xmlStrcat(msg, BAD_CAST " WC]: "); + msg = xmlStrcat(msg, BAD_CAST " wildcard]: "); msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST ".\n"); xmlSchemaVErr(ctxt, node, error, (const char *) msg, BAD_CAST des, NULL); @@ -15237,10 +15270,10 @@ xmlSchemaValidateElementByDeclaration(xmlSchemaValidCtxtPtr ctxt, * the spec. */ if (actualType == NULL) { - xmlSchemaVComplexTypeErr(ctxt, + xmlSchemaVCustomErr(ctxt, XML_SCHEMAV_CVC_TYPE_1, elem, (xmlSchemaTypePtr) elemDecl, - "The type definition is absent"); + "The type definition is absent", NULL); return (XML_SCHEMAV_CVC_TYPE_1); } @@ -15814,7 +15847,7 @@ xmlSchemaValidateElementByComplexType(xmlSchemaValidCtxtPtr ctxt, else nsUri = NULL; ret = xmlRegExecPushString2(ctxt->regexp, - child->name, nsUri, child); + child->name, nsUri, child); /* * URGENT TODO: Could we anchor an error report * here to notify of invalid elements? @@ -15827,6 +15860,13 @@ xmlSchemaValidateElementByComplexType(xmlSchemaValidCtxtPtr ctxt, xmlGenericError(xmlGenericErrorContext, " --> %s\n", child->name); #endif + if (ret < 0) { + xmlSchemaVComplexTypeErr(ctxt, + XML_SCHEMAV_ELEMENT_CONTENT, + child, NULL/* type */, + "This element is not expected"); + ret = 1; + } } else if ((type->contentType == XML_SCHEMA_CONTENT_ELEMENTS) && /* * TODO: Ask Daniel if this are all character nodes. @@ -15846,7 +15886,8 @@ xmlSchemaValidateElementByComplexType(xmlSchemaValidCtxtPtr ctxt, XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, elem, type, "Character content is not allowed, " - "because the content type is element-only"); + "because the content type is element-only"); + ret = 1; break; } child = child->next; @@ -15855,24 +15896,29 @@ xmlSchemaValidateElementByComplexType(xmlSchemaValidCtxtPtr ctxt, * Content model check finalization. */ if (type->contModel != NULL) { - ret = xmlRegExecPushString(ctxt->regexp, NULL, NULL); + if (ret != 1) { + ret = xmlRegExecPushString(ctxt->regexp, NULL, NULL); #ifdef DEBUG_AUTOMATA - xmlGenericError(xmlGenericErrorContext, - "====> %s : %d\n", elem->name, ret); + xmlGenericError(xmlGenericErrorContext, + "====> %s : %d\n", elem->name, ret); #endif - if (ret == 0) { - xmlSchemaVCustomErr(ctxt, XML_SCHEMAV_ELEMENT_CONTENT, - elem, type, "The element content is not valid", NULL); - } else if (ret < 0) { - xmlSchemaVCustomErr(ctxt, XML_SCHEMAV_ELEMENT_CONTENT, - elem, type, "The element content is not valid", NULL); + if (ret == 0) { + /* TODO: Hmm, can this one really happen? */ + xmlSchemaVComplexTypeErr(ctxt, + XML_SCHEMAV_ELEMENT_CONTENT, + elem, type, "Missing child element(s)"); + } else if (ret < 0) { + xmlSchemaVComplexTypeErr(ctxt, + XML_SCHEMAV_ELEMENT_CONTENT, + elem, type, "Missing child element(s)"); #ifdef DEBUG_CONTENT - } else { - xmlGenericError(xmlGenericErrorContext, - "Element %s content check succeeded\n", - elem->name); - + } else { + xmlGenericError(xmlGenericErrorContext, + "Element %s content check succeeded\n", + elem->name); + #endif + } } xmlRegFreeExecCtxt(ctxt->regexp); ctxt->regexp = oldregexp; @@ -16043,18 +16089,18 @@ xmlSchemaValidateElementByType(xmlSchemaValidCtxtPtr ctxt, * procedures for the given type. */ if (type == NULL) { - xmlSchemaVComplexTypeErr(ctxt, + xmlSchemaVCustomErr(ctxt, XML_SCHEMAV_CVC_TYPE_1, ctxt->node, NULL, - "The type definition is absent"); + "The type definition is absent", NULL); return (XML_SCHEMAV_CVC_TYPE_1); } if (type->flags & XML_SCHEMAS_TYPE_ABSTRACT) { - xmlSchemaVComplexTypeErr(ctxt, + xmlSchemaVCustomErr(ctxt, XML_SCHEMAV_CVC_TYPE_2, ctxt->node, type, - "The type definition is abstract"); + "The type definition is abstract", NULL); return (XML_SCHEMAV_CVC_TYPE_2); } |