diff --git a/ChangeLog b/ChangeLog index 5790ad74..1df0fbc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Apr 19 09:00:56 CEST 2002 Daniel Veillard + + * xmlschemas.c: more Schemas work + * test/schemas/* result/schemas/*: added more tests coming + from the spec. + Thu Apr 18 23:00:02 CEST 2002 Daniel Veillard * c14n.c: patch from Aleksey Sanin reflecting a change in the diff --git a/result/schemas/extension0_0_0 b/result/schemas/extension0_0_0 new file mode 100644 index 00000000..d3dca7b9 --- /dev/null +++ b/result/schemas/extension0_0_0 @@ -0,0 +1 @@ +./test/schemas/extension0_0.xml validates diff --git a/result/schemas/extension0_0_0.err b/result/schemas/extension0_0_0.err new file mode 100644 index 00000000..583ecb5d --- /dev/null +++ b/result/schemas/extension0_0_0.err @@ -0,0 +1,44 @@ +Type of sequence 4 : ./test/schemas/extension0_0.xsd:13 :elements +Type of sequence 4 : ./test/schemas/extension0_0.xsd:13 :elements +Type of sequence 1 : ./test/schemas/extension0_0.xsd:4 :elements +Type of personName : ./test/schemas/extension0_0.xsd:3 :elements +Type of extension 3 : ./test/schemas/extension0_0.xsd:12 :elements +Type of extension 3 : ./test/schemas/extension0_0.xsd:12 :elements +Type of complexContent 2 : ./test/schemas/extension0_0.xsd:11 :elements +Type of complexContent 2 : ./test/schemas/extension0_0.xsd:11 :elements +Type of extendedName : ./test/schemas/extension0_0.xsd:10 :elements +Type of personName : ./test/schemas/extension0_0.xsd:3 :elements +Type of sequence 1 : ./test/schemas/extension0_0.xsd:4 :elements +Building content model for addressee +Content model of addressee: + regexp: '(null)' +4 atoms: + 00 atom: string once 'title' + 01 atom: string once 'forename' + 02 atom: string once 'surname' + 03 atom: string once 'generation' +5 states: + state: 0, 4 transitions: + trans: atom 0, to 1 + trans: removed + trans: atom 1, to 2 + trans: atom 2, to 3 + state: 1, 3 transitions: + trans: atom 1, to 2 + trans: removed + trans: atom 2, to 3 + state: 2, 4 transitions: + trans: removed + trans: atom 2, to 3 + trans: atom 1, to 2 + trans: atom 2, to 3 + state: FINAL 3, 2 transitions: + trans: atom 3, to 4 + trans: removed + state: FINAL 4, 0 transitions: +0 counters: +xmlSchemaValidateCallback: forename, forename, forename +xmlSchemaValidateCallback: forename, forename, forename +xmlSchemaValidateCallback: surname, surname, surname +xmlSchemaValidateCallback: generation, generation, generation +Element addressee content check succeeded diff --git a/result/schemas/length2_0_0 b/result/schemas/length2_0_0 new file mode 100644 index 00000000..4fd27d66 --- /dev/null +++ b/result/schemas/length2_0_0 @@ -0,0 +1 @@ +./test/schemas/length2_0.xml validates diff --git a/result/schemas/length2_0_0.err b/result/schemas/length2_0_0.err new file mode 100644 index 00000000..8e88f78c --- /dev/null +++ b/result/schemas/length2_0_0.err @@ -0,0 +1,24 @@ +Unable to lookup type nonPositiveInteger:http://www.w3.org/2001/XMLSchemaSchemas: element size type nonPositiveInteger not found +Type of sequence 3 : ./test/schemas/length2_0.xsd:6 :elements +Type of sequence 3 : ./test/schemas/length2_0.xsd:6 :elements +Type of restriction 2 : ./test/schemas/length2_0.xsd:5 :elements +Type of complexContent 1 : ./test/schemas/length2_0.xsd:4 :elements +Type of length2 : ./test/schemas/length2_0.xsd:3 :elements +Type of complexContent 1 : ./test/schemas/length2_0.xsd:4 :elements +Type of restriction 2 : ./test/schemas/length2_0.xsd:5 :elements +Building content model for depth +Content model of depth: + regexp: '(null)' +2 atoms: + 00 atom: string once 'size' + 01 atom: string once 'unit' +3 states: + state: 0, 1 transitions: + trans: atom 0, to 1 + state: 1, 1 transitions: + trans: atom 1, to 2 + state: FINAL 2, 0 transitions: +0 counters: +xmlSchemaValidateCallback: size, size, size +xmlSchemaValidateCallback: unit, unit, unit +Element depth content check succeeded diff --git a/result/schemas/length3_0_0 b/result/schemas/length3_0_0 new file mode 100644 index 00000000..6ea75159 --- /dev/null +++ b/result/schemas/length3_0_0 @@ -0,0 +1 @@ +./test/schemas/length3_0.xml validates diff --git a/result/schemas/length3_0_0.err b/result/schemas/length3_0_0.err new file mode 100644 index 00000000..32f7f6b4 --- /dev/null +++ b/result/schemas/length3_0_0.err @@ -0,0 +1,20 @@ +Unable to lookup type non-positive-integer:http://www.w3.org/2001/XMLSchemaSchemas: element size type non-positive-integer not found +Type of sequence 1 : ./test/schemas/length3_0.xsd:4 :elements +Type of length3 : ./test/schemas/length3_0.xsd:3 :elements +Type of sequence 1 : ./test/schemas/length3_0.xsd:4 :elements +Building content model for depth +Content model of depth: + regexp: '(null)' +2 atoms: + 00 atom: string once 'size' + 01 atom: string once 'unit' +3 states: + state: 0, 1 transitions: + trans: atom 0, to 1 + state: 1, 1 transitions: + trans: atom 1, to 2 + state: FINAL 2, 0 transitions: +0 counters: +xmlSchemaValidateCallback: size, size, size +xmlSchemaValidateCallback: unit, unit, unit +Element depth content check succeeded diff --git a/result/schemas/restriction0_0_0 b/result/schemas/restriction0_0_0 new file mode 100644 index 00000000..16ef2bc4 --- /dev/null +++ b/result/schemas/restriction0_0_0 @@ -0,0 +1 @@ +./test/schemas/restriction0_0.xml validates diff --git a/result/schemas/restriction0_0_0.err b/result/schemas/restriction0_0_0.err new file mode 100644 index 00000000..fe94ad1c --- /dev/null +++ b/result/schemas/restriction0_0_0.err @@ -0,0 +1,26 @@ +Type of sequence 4 : ./test/schemas/restriction0_0.xsd:13 :elements +Type of sequence 4 : ./test/schemas/restriction0_0.xsd:13 :elements +Type of restriction 3 : ./test/schemas/restriction0_0.xsd:12 :elements +Type of complexContent 2 : ./test/schemas/restriction0_0.xsd:11 :elements +Type of complexContent 2 : ./test/schemas/restriction0_0.xsd:11 :elements +Type of simpleName : ./test/schemas/restriction0_0.xsd:10 :elements +Type of sequence 1 : ./test/schemas/restriction0_0.xsd:4 :elements +Type of personName : ./test/schemas/restriction0_0.xsd:3 :elements +Type of sequence 1 : ./test/schemas/restriction0_0.xsd:4 :elements +Type of restriction 3 : ./test/schemas/restriction0_0.xsd:12 :elements +Building content model for who +Content model of who: + regexp: '(null)' +2 atoms: + 00 atom: string once 'forename' + 01 atom: string once 'surname' +3 states: + state: 0, 1 transitions: + trans: atom 0, to 1 + state: 1, 1 transitions: + trans: atom 1, to 2 + state: FINAL 2, 0 transitions: +0 counters: +xmlSchemaValidateCallback: forename, forename, forename +xmlSchemaValidateCallback: surname, surname, surname +Element who content check succeeded diff --git a/test/schemas/length2_0.xml b/test/schemas/length2_0.xml new file mode 100644 index 00000000..5c851daf --- /dev/null +++ b/test/schemas/length2_0.xml @@ -0,0 +1,5 @@ + + + 25 + cm + diff --git a/test/schemas/length2_0.xsd b/test/schemas/length2_0.xsd new file mode 100644 index 00000000..4344a703 --- /dev/null +++ b/test/schemas/length2_0.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/test/schemas/length3_0.xml b/test/schemas/length3_0.xml new file mode 100644 index 00000000..5c851daf --- /dev/null +++ b/test/schemas/length3_0.xml @@ -0,0 +1,5 @@ + + + 25 + cm + diff --git a/test/schemas/length3_0.xsd b/test/schemas/length3_0.xsd new file mode 100644 index 00000000..b97e6881 --- /dev/null +++ b/test/schemas/length3_0.xsd @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/schemas/restriction0_0.xml b/test/schemas/restriction0_0.xml new file mode 100644 index 00000000..8656d2c4 --- /dev/null +++ b/test/schemas/restriction0_0.xml @@ -0,0 +1,5 @@ + + + Bill + Clinton + diff --git a/test/schemas/restriction0_0.xsd b/test/schemas/restriction0_0.xsd new file mode 100644 index 00000000..6b35b9f3 --- /dev/null +++ b/test/schemas/restriction0_0.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/xmlschemas.c b/xmlschemas.c index 3a96b635..8cb9400b 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -3041,9 +3041,7 @@ xmlSchemaBuildAContentModel(xmlSchemaTypePtr type, break; } case XML_SCHEMA_TYPE_RESTRICTION: - if (type->baseType != NULL) { - TODO - } else if (type->subtypes != NULL) + if (type->subtypes != NULL) xmlSchemaBuildAContentModel(type->subtypes, ctxt, name); break; case XML_SCHEMA_TYPE_EXTENSION: @@ -3685,6 +3683,8 @@ skip_children: * Then do the parsing for good */ ret = xmlSchemaParseSchema(ctxt, root); + if (ret == NULL) + return(NULL); ret->doc = doc; /*