mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-28 07:21:26 +03:00
applied patch from Adam Dickmeiss for mixed content added his regression
* xmlschemas.c: applied patch from Adam Dickmeiss for mixed content * test/schemas/mixed* result/schemas/mixed*: added his regression tests too. Daniel
This commit is contained in:
parent
3411d08e3c
commit
1aefc862f3
@ -1,3 +1,9 @@
|
||||
Thu Mar 4 12:38:53 CET 2004 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* 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 <daniel@veillard.com>
|
||||
|
||||
* testSAX.c: fix a compilation problem about a missing timb include
|
||||
|
1
result/schemas/mixed0_0_0
Normal file
1
result/schemas/mixed0_0_0
Normal file
@ -0,0 +1 @@
|
||||
./test/schemas/mixed0_0.xml validates
|
0
result/schemas/mixed0_0_0.err
Normal file
0
result/schemas/mixed0_0_0.err
Normal file
1
result/schemas/mixed1_0_0
Normal file
1
result/schemas/mixed1_0_0
Normal file
@ -0,0 +1 @@
|
||||
./test/schemas/mixed1_0.xml validates
|
0
result/schemas/mixed1_0_0.err
Normal file
0
result/schemas/mixed1_0_0.err
Normal file
1
test/schemas/mixed0_0.xml
Normal file
1
test/schemas/mixed0_0.xml
Normal file
@ -0,0 +1 @@
|
||||
<my>x</my>
|
5
test/schemas/mixed0_0.xsd
Normal file
5
test/schemas/mixed0_0.xsd
Normal file
@ -0,0 +1,5 @@
|
||||
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
|
||||
<xs:element name='my'>
|
||||
<xs:complexType mixed='true'/>
|
||||
</xs:element>
|
||||
</xs:schema>
|
1
test/schemas/mixed1_0.xml
Normal file
1
test/schemas/mixed1_0.xml
Normal file
@ -0,0 +1 @@
|
||||
<my myattr='y'>x</my>
|
7
test/schemas/mixed1_0.xsd
Normal file
7
test/schemas/mixed1_0.xsd
Normal file
@ -0,0 +1,7 @@
|
||||
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
|
||||
<xs:element name='my'>
|
||||
<xs:complexType mixed='true'>
|
||||
<xs:attribute name='myattr' type='xs:string' use='required'/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
13
xmlschemas.c
13
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 =
|
||||
|
Loading…
Reference in New Issue
Block a user