mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-07 06:43:02 +03:00
more Schemas work added more tests coming from the spec. Daniel
* Makefile.am xmlschemas.c: more Schemas work * test/schemas/* result/schemas/*: added more tests coming from the spec. Daniel
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
Thu Apr 18 16:40:42 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* Makefile.am xmlschemas.c: more Schemas work
|
||||||
|
* test/schemas/* result/schemas/*: added more tests coming
|
||||||
|
from the spec.
|
||||||
|
|
||||||
Thu Apr 18 13:52:52 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
Thu Apr 18 13:52:52 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* HTMLtree.c: fixed & serialization bug introduced in 2.4.20
|
* HTMLtree.c: fixed & serialization bug introduced in 2.4.20
|
||||||
|
@@ -5,8 +5,8 @@ SUBDIRS = include . doc example python
|
|||||||
|
|
||||||
INCLUDES = -I@srcdir@/include -I$(top_builddir)/include @THREAD_CFLAGS@ @Z_CFLAGS@
|
INCLUDES = -I@srcdir@/include -I$(top_builddir)/include @THREAD_CFLAGS@ @Z_CFLAGS@
|
||||||
|
|
||||||
noinst_PROGRAMS=testSAX testHTML testXPath testURI testDocbook testThreads \
|
noinst_PROGRAMS=testSchemas testSAX testHTML testXPath testURI testDocbook \
|
||||||
testC14N testAutomata testSchemas testRegexp
|
testThreads testC14N testAutomata testRegexp
|
||||||
|
|
||||||
bin_PROGRAMS = xmllint xmlcatalog
|
bin_PROGRAMS = xmllint xmlcatalog
|
||||||
|
|
||||||
|
@@ -18,7 +18,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -18,7 +18,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: b, b, b
|
xmlSchemaValidateCallback: b, b, b
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -18,7 +18,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -18,7 +18,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -18,6 +18,4 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -18,7 +18,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -18,7 +18,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -19,7 +19,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -19,7 +19,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: b, b, b
|
xmlSchemaValidateCallback: b, b, b
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -19,7 +19,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -19,7 +19,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -19,6 +19,4 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -19,7 +19,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -19,7 +19,5 @@ Content model of doc:
|
|||||||
state: FINAL 3, 1 transitions:
|
state: FINAL 3, 1 transitions:
|
||||||
trans: removed
|
trans: removed
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -34,7 +34,5 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -34,8 +34,6 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: b, b, b
|
xmlSchemaValidateCallback: b, b, b
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
(nil) : Freed()
|
(nil) : Freed()
|
||||||
|
@@ -34,8 +34,6 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
xmlSchemaValidateCallback: b, b, b
|
xmlSchemaValidateCallback: b, b, b
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -34,8 +34,6 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
Element doc content check succeeded
|
Element doc content check succeeded
|
||||||
|
@@ -34,6 +34,4 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
Element doc content check failed
|
Element doc content check failed
|
||||||
|
@@ -34,8 +34,6 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
xmlSchemaValidateCallback: b, b, b
|
xmlSchemaValidateCallback: b, b, b
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
|
@@ -34,8 +34,6 @@ Content model of doc:
|
|||||||
trans: counted 0, atom 1, to 4
|
trans: counted 0, atom 1, to 4
|
||||||
1 counters:
|
1 counters:
|
||||||
0: min 0 max 2
|
0: min 0 max 2
|
||||||
Building content model for a
|
|
||||||
Building content model for b
|
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
xmlSchemaValidateCallback: b, b, b
|
xmlSchemaValidateCallback: b, b, b
|
||||||
xmlSchemaValidateCallback: a, a, a
|
xmlSchemaValidateCallback: a, a, a
|
||||||
|
1
result/schemas/length1_0_0
Normal file
1
result/schemas/length1_0_0
Normal file
@@ -0,0 +1 @@
|
|||||||
|
./test/schemas/length1_0.xml validates
|
6
result/schemas/length1_0_0.err
Normal file
6
result/schemas/length1_0_0.err
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Type of nonNegativeInteger :basic
|
||||||
|
Type of extension 2 : ./test/schemas/length1_0.xsd:5 :basic
|
||||||
|
Type of complexContent 1 : ./test/schemas/length1_0.xsd:4 :basic
|
||||||
|
Type of length1 : ./test/schemas/length1_0.xsd:3 :basic
|
||||||
|
Type of extension 2 : ./test/schemas/length1_0.xsd:5 :basic
|
||||||
|
Type of complexContent 1 : ./test/schemas/length1_0.xsd:4 :basic
|
@@ -14,9 +14,6 @@ Type of restriction 10 : ./test/schemas/po0_0.xsd:54 :empty
|
|||||||
Type of sequence 1 : ./test/schemas/po0_0.xsd:12 :elements
|
Type of sequence 1 : ./test/schemas/po0_0.xsd:12 :elements
|
||||||
Type of sequence 3 : ./test/schemas/po0_0.xsd:21 :elements
|
Type of sequence 3 : ./test/schemas/po0_0.xsd:21 :elements
|
||||||
Type of USAddress : ./test/schemas/po0_0.xsd:20 :elements
|
Type of USAddress : ./test/schemas/po0_0.xsd:20 :elements
|
||||||
Building content model for anonelem2
|
|
||||||
Building content model for street
|
|
||||||
Building content model for state
|
|
||||||
Building content model for shipTo
|
Building content model for shipTo
|
||||||
Content model of shipTo:
|
Content model of shipTo:
|
||||||
regexp: '(null)'
|
regexp: '(null)'
|
||||||
@@ -39,8 +36,6 @@ Content model of shipTo:
|
|||||||
trans: atom 4, to 5
|
trans: atom 4, to 5
|
||||||
state: FINAL 5, 0 transitions:
|
state: FINAL 5, 0 transitions:
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for comment
|
|
||||||
Building content model for name
|
|
||||||
Building content model for item
|
Building content model for item
|
||||||
Content model of item:
|
Content model of item:
|
||||||
regexp: '(null)'
|
regexp: '(null)'
|
||||||
@@ -66,9 +61,6 @@ Content model of item:
|
|||||||
trans: removed
|
trans: removed
|
||||||
state: FINAL 5, 0 transitions:
|
state: FINAL 5, 0 transitions:
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for productName
|
|
||||||
Building content model for anonelem9
|
|
||||||
Building content model for quantity
|
|
||||||
Building content model for purchaseOrder
|
Building content model for purchaseOrder
|
||||||
Content model of purchaseOrder:
|
Content model of purchaseOrder:
|
||||||
regexp: '(null)'
|
regexp: '(null)'
|
||||||
@@ -112,8 +104,6 @@ Content model of billTo:
|
|||||||
trans: atom 4, to 5
|
trans: atom 4, to 5
|
||||||
state: FINAL 5, 0 transitions:
|
state: FINAL 5, 0 transitions:
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for zip
|
|
||||||
Building content model for USPrice
|
|
||||||
Building content model for items
|
Building content model for items
|
||||||
Content model of items:
|
Content model of items:
|
||||||
regexp: '(null)'
|
regexp: '(null)'
|
||||||
@@ -127,8 +117,6 @@ Content model of items:
|
|||||||
trans: removed
|
trans: removed
|
||||||
trans: atom 0, to 1
|
trans: atom 0, to 1
|
||||||
0 counters:
|
0 counters:
|
||||||
Building content model for city
|
|
||||||
Building content model for shipDate
|
|
||||||
xmlSchemaValidateCallback: shipTo, shipTo, shipTo
|
xmlSchemaValidateCallback: shipTo, shipTo, shipTo
|
||||||
xmlSchemaValidateCallback: name, name, name
|
xmlSchemaValidateCallback: name, name, name
|
||||||
xmlSchemaValidateCallback: street, street, street
|
xmlSchemaValidateCallback: street, street, street
|
||||||
|
7
test/schemas/extension0_0.xml
Normal file
7
test/schemas/extension0_0.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<addressee>
|
||||||
|
<forename>Albert</forename>
|
||||||
|
<forename>Arnold</forename>
|
||||||
|
<surname>Gore</surname>
|
||||||
|
<generation>Jr</generation>
|
||||||
|
</addressee>
|
20
test/schemas/extension0_0.xsd
Normal file
20
test/schemas/extension0_0.xsd
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?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="extendedName">
|
||||||
|
<xs:complexContent>
|
||||||
|
<xs:extension base="personName">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="generation" minOccurs="0"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:complexContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:element name="addressee" type="extendedName"/>
|
||||||
|
</xs:schema>
|
1
test/schemas/length1_0.xml
Normal file
1
test/schemas/length1_0.xml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<width unit="cm">25</width>
|
11
test/schemas/length1_0.xsd
Normal file
11
test/schemas/length1_0.xsd
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<xs:complexType name="length1">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:nonNegativeInteger">
|
||||||
|
<xs:attribute name="unit" type="xs:NMTOKEN"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:element name="width" type="length1"/>
|
||||||
|
</xs:schema>
|
40
xmlschemas.c
40
xmlschemas.c
@@ -2676,7 +2676,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
|||||||
child = child->next;
|
child = child->next;
|
||||||
}
|
}
|
||||||
if (IS_SCHEMA(child, "simpleContent")) {
|
if (IS_SCHEMA(child, "simpleContent")) {
|
||||||
subtype = xmlSchemaParseSimpleContent(ctxt, schema, child);
|
type->subtypes = xmlSchemaParseSimpleContent(ctxt, schema, child);
|
||||||
child = child->next;
|
child = child->next;
|
||||||
} else if (IS_SCHEMA(child, "complexContent")) {
|
} else if (IS_SCHEMA(child, "complexContent")) {
|
||||||
type->subtypes = xmlSchemaParseComplexContent(ctxt, schema, child);
|
type->subtypes = xmlSchemaParseComplexContent(ctxt, schema, child);
|
||||||
@@ -3085,17 +3085,20 @@ xmlSchemaBuildContentModel(xmlSchemaElementPtr elem,
|
|||||||
const xmlChar *name) {
|
const xmlChar *name) {
|
||||||
xmlAutomataStatePtr start;
|
xmlAutomataStatePtr start;
|
||||||
|
|
||||||
#ifdef DEBUG_CONTENT
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
|
||||||
"Building content model for %s\n", name);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (elem->contModel != NULL)
|
if (elem->contModel != NULL)
|
||||||
return;
|
return;
|
||||||
if (elem->subtypes == NULL)
|
if (elem->subtypes == NULL)
|
||||||
return;
|
return;
|
||||||
if (elem->subtypes->type != XML_SCHEMA_TYPE_COMPLEX)
|
if (elem->subtypes->type != XML_SCHEMA_TYPE_COMPLEX)
|
||||||
return;
|
return;
|
||||||
|
if (elem->subtypes->contentType == XML_SCHEMA_CONTENT_BASIC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
#ifdef DEBUG_CONTENT
|
||||||
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
|
"Building content model for %s\n", name);
|
||||||
|
#endif
|
||||||
|
|
||||||
ctxt->am = xmlNewAutomata();
|
ctxt->am = xmlNewAutomata();
|
||||||
if (ctxt->am == NULL) {
|
if (ctxt->am == NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@@ -3351,9 +3354,14 @@ xmlSchemaTypeFixup(xmlSchemaTypePtr typeDecl,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_TYPE
|
#ifdef DEBUG_TYPE
|
||||||
|
if (typeDecl->node != NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"Type of %s : %s:%d :", name, typeDecl->node->doc->URL,
|
"Type of %s : %s:%d :", name, typeDecl->node->doc->URL,
|
||||||
xmlGetLineNo(typeDecl->node));
|
xmlGetLineNo(typeDecl->node));
|
||||||
|
} else {
|
||||||
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
|
"Type of %s :", name);
|
||||||
|
}
|
||||||
switch (typeDecl->contentType) {
|
switch (typeDecl->contentType) {
|
||||||
case XML_SCHEMA_CONTENT_SIMPLE:
|
case XML_SCHEMA_CONTENT_SIMPLE:
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@@ -4465,6 +4473,21 @@ xmlSchemaValidateComplexType(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr node) {
|
|||||||
child = xmlSchemaSkipIgnored(ctxt, type, child);
|
child = xmlSchemaSkipIgnored(ctxt, type, child);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case XML_SCHEMA_CONTENT_BASIC: {
|
||||||
|
if (type->subtypes != NULL) {
|
||||||
|
ctxt->type = type->subtypes;
|
||||||
|
xmlSchemaValidateComplexType(ctxt, node);
|
||||||
|
}
|
||||||
|
if (type->baseType != NULL) {
|
||||||
|
ctxt->type = type->baseType;
|
||||||
|
xmlSchemaValidateBasicType(ctxt, node);
|
||||||
|
}
|
||||||
|
if (type->attributes != NULL) {
|
||||||
|
xmlSchemaValidateAttributes(ctxt, node, type->attributes);
|
||||||
|
}
|
||||||
|
ctxt->type = type;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
TODO
|
TODO
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@@ -4813,6 +4836,7 @@ xmlSchemaValidateElement(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
xmlSchemaValidateType(ctxt, elem, elemDecl, elemDecl->subtypes);
|
xmlSchemaValidateType(ctxt, elem, elemDecl, elemDecl->subtypes);
|
||||||
|
if (elemDecl->contModel != NULL) {
|
||||||
ret = xmlRegExecPushString(ctxt->regexp, NULL, NULL);
|
ret = xmlRegExecPushString(ctxt->regexp, NULL, NULL);
|
||||||
#ifdef DEBUG_AUTOMATA
|
#ifdef DEBUG_AUTOMATA
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@@ -4835,7 +4859,6 @@ xmlSchemaValidateElement(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (elemDecl->contModel != NULL) {
|
|
||||||
xmlRegFreeExecCtxt(ctxt->regexp);
|
xmlRegFreeExecCtxt(ctxt->regexp);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -4881,8 +4904,7 @@ xmlSchemaValidateDocument(xmlSchemaValidCtxtPtr ctxt, xmlDocPtr doc) {
|
|||||||
if (ctxt->error != NULL)
|
if (ctxt->error != NULL)
|
||||||
ctxt->error(ctxt->userData, "Element %s not declared\n",
|
ctxt->error(ctxt->userData, "Element %s not declared\n",
|
||||||
root->name);
|
root->name);
|
||||||
}
|
} else if ((elemDecl->flags & XML_SCHEMAS_ELEM_TOPLEVEL) == 0) {
|
||||||
if ((elemDecl->flags & XML_SCHEMAS_ELEM_TOPLEVEL) == 0) {
|
|
||||||
ctxt->err = XML_SCHEMAS_ERR_NOTTOPLEVEL;
|
ctxt->err = XML_SCHEMAS_ERR_NOTTOPLEVEL;
|
||||||
if (ctxt->error != NULL)
|
if (ctxt->error != NULL)
|
||||||
ctxt->error(ctxt->userData, "Root element %s not toplevel\n",
|
ctxt->error(ctxt->userData, "Root element %s not toplevel\n",
|
||||||
|
Reference in New Issue
Block a user