diff --git a/ChangeLog b/ChangeLog index ec44b5e0..7e4402b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 4 12:38:53 CET 2004 Daniel Veillard + + * xmlschemas.c: applied patch from Adam Dickmeiss for mixed content + * test/schemas/mixed* result/schemas/mixed*: added his regression + tests too. + Mon Mar 1 15:22:06 CET 2004 Daniel Veillard * testSAX.c: fix a compilation problem about a missing timb include diff --git a/result/schemas/mixed0_0_0 b/result/schemas/mixed0_0_0 new file mode 100644 index 00000000..bd2f0ed8 --- /dev/null +++ b/result/schemas/mixed0_0_0 @@ -0,0 +1 @@ +./test/schemas/mixed0_0.xml validates diff --git a/result/schemas/mixed0_0_0.err b/result/schemas/mixed0_0_0.err new file mode 100644 index 00000000..e69de29b diff --git a/result/schemas/mixed1_0_0 b/result/schemas/mixed1_0_0 new file mode 100644 index 00000000..e9a6b016 --- /dev/null +++ b/result/schemas/mixed1_0_0 @@ -0,0 +1 @@ +./test/schemas/mixed1_0.xml validates diff --git a/result/schemas/mixed1_0_0.err b/result/schemas/mixed1_0_0.err new file mode 100644 index 00000000..e69de29b diff --git a/test/schemas/mixed0_0.xml b/test/schemas/mixed0_0.xml new file mode 100644 index 00000000..58643438 --- /dev/null +++ b/test/schemas/mixed0_0.xml @@ -0,0 +1 @@ +x diff --git a/test/schemas/mixed0_0.xsd b/test/schemas/mixed0_0.xsd new file mode 100644 index 00000000..a82226ec --- /dev/null +++ b/test/schemas/mixed0_0.xsd @@ -0,0 +1,5 @@ + + + + + diff --git a/test/schemas/mixed1_0.xml b/test/schemas/mixed1_0.xml new file mode 100644 index 00000000..d8cf6337 --- /dev/null +++ b/test/schemas/mixed1_0.xml @@ -0,0 +1 @@ +x diff --git a/test/schemas/mixed1_0.xsd b/test/schemas/mixed1_0.xsd new file mode 100644 index 00000000..a9ea6cc6 --- /dev/null +++ b/test/schemas/mixed1_0.xsd @@ -0,0 +1,7 @@ + + + + + + + diff --git a/xmlschemas.c b/xmlschemas.c index f9e51533..2266f497 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -3581,6 +3581,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, xmlNodePtr child = NULL; const xmlChar *name; const xmlChar *oldcontainer; + const xmlChar *mixed; char buf[100]; if ((ctxt == NULL) || (schema == NULL) || (node == NULL)) @@ -3602,6 +3603,11 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, if (type == NULL) { return (NULL); } + + mixed = xmlSchemaGetProp(ctxt, node, "mixed"); + if (mixed != NULL) + type->flags |= XML_SCHEMAS_TYPE_MIXED; + type->node = node; type->type = XML_SCHEMA_TYPE_COMPLEX; type->id = xmlSchemaGetProp(ctxt, node, "id"); @@ -4491,6 +4497,10 @@ xmlSchemaTypeFixup(xmlSchemaTypePtr typeDecl, case XML_SCHEMA_TYPE_COMPLEX:{ if (typeDecl->subtypes == NULL) { typeDecl->contentType = XML_SCHEMA_CONTENT_EMPTY; + + if (typeDecl->flags & XML_SCHEMAS_TYPE_MIXED) + typeDecl->contentType = + XML_SCHEMA_CONTENT_MIXED; } else { if (typeDecl->flags & XML_SCHEMAS_TYPE_MIXED) typeDecl->contentType = @@ -4511,6 +4521,9 @@ xmlSchemaTypeFixup(xmlSchemaTypePtr typeDecl, case XML_SCHEMA_TYPE_COMPLEX_CONTENT:{ if (typeDecl->subtypes == NULL) { typeDecl->contentType = XML_SCHEMA_CONTENT_EMPTY; + if (typeDecl->flags & XML_SCHEMAS_TYPE_MIXED) + typeDecl->contentType = + XML_SCHEMA_CONTENT_MIXED; } else { if (typeDecl->flags & XML_SCHEMAS_TYPE_MIXED) typeDecl->contentType =