Commit b4398969 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

more Schemas work added more tests coming from the spec. Daniel

* xmlschemas.c: more Schemas work
* test/schemas/* result/schemas/*: added more tests coming
  from the spec.
Daniel
parent 54761130
Fri Apr 19 09:00:56 CEST 2002 Daniel Veillard <daniel@veillard.com>
* 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 <daniel@veillard.com>
* c14n.c: patch from Aleksey Sanin reflecting a change in the
......
./test/schemas/extension0_0.xml validates
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
./test/schemas/length2_0.xml validates
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
./test/schemas/length3_0.xml validates
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
./test/schemas/restriction0_0.xml validates
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
<?xml version="1.0"?>
<depth>
<size>25</size>
<unit>cm</unit>
</depth>
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="length2">
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:sequence>
<xs:element name="size" type="xs:nonPositiveInteger"/>
<xs:element name="unit" type="xs:NMTOKEN"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:element name="depth" type="length2"/>
</xs:schema>
<?xml version="1.0"?>
<depth>
<size>25</size>
<unit>cm</unit>
</depth>
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="length3">
<xs:sequence>
<xs:element name="size" type="xs:non-positive-integer"/>
<xs:element name="unit" type="xs:NMTOKEN"/>
</xs:sequence>
</xs:complexType>
<xs:element name="depth" type="length3"/>
</xs:schema>
<?xml version="1.0"?>
<who>
<forename>Bill</forename>
<surname>Clinton</surname>
</who>
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="personName">
<xs:sequence>
<xs:element name="title" minOccurs="0"/>
<xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="surname"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="simpleName">
<xs:complexContent>
<xs:restriction base="personName">
<xs:sequence>
<xs:element name="forename" minOccurs="1" maxOccurs="1"/>
<xs:element name="surname"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:element name="who" type="simpleName"/>
</xs:schema>
......@@ -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;
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment