mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
added tests for xs:all to assure minOccurs and maxOccurs <= 1 (Bug 130020)
* xmlschemas.c: added tests for xs:all to assure minOccurs and maxOccurs <= 1 (Bug 130020)
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Sat Dec 27 12:32:58 HKT 2003 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
|
* xmlschemas.c: added tests for xs:all to assure minOccurs
|
||||||
|
and maxOccurs <= 1 (Bug 130020)
|
||||||
|
|
||||||
Sat Dec 27 09:53:06 HKT 2003 William Brack <wbrack@mmm.com.hk>
|
Sat Dec 27 09:53:06 HKT 2003 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
* xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges
|
* xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges
|
||||||
|
14
xmlschemas.c
14
xmlschemas.c
@ -2563,7 +2563,13 @@ xmlSchemaParseAll(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
|||||||
type->type = XML_SCHEMA_TYPE_ALL;
|
type->type = XML_SCHEMA_TYPE_ALL;
|
||||||
type->id = xmlSchemaGetProp(ctxt, node, "id");
|
type->id = xmlSchemaGetProp(ctxt, node, "id");
|
||||||
type->minOccurs = xmlGetMinOccurs(ctxt, node);
|
type->minOccurs = xmlGetMinOccurs(ctxt, node);
|
||||||
|
if (type->minOccurs > 1)
|
||||||
|
xmlSchemaPErr(ctxt, node, XML_SCHEMAP_INVALID_MINOCCURS,
|
||||||
|
"invalid value for minOccurs (must be 0 or 1)\n", NULL, NULL);
|
||||||
type->maxOccurs = xmlGetMaxOccurs(ctxt, node);
|
type->maxOccurs = xmlGetMaxOccurs(ctxt, node);
|
||||||
|
if (type->maxOccurs > 1)
|
||||||
|
xmlSchemaPErr(ctxt, node, XML_SCHEMAP_INVALID_MAXOCCURS,
|
||||||
|
"invalid value for maxOccurs (must be 0 or 1)\n", NULL, NULL);
|
||||||
|
|
||||||
child = node->children;
|
child = node->children;
|
||||||
if (IS_SCHEMA(child, "annotation")) {
|
if (IS_SCHEMA(child, "annotation")) {
|
||||||
@ -2574,6 +2580,14 @@ xmlSchemaParseAll(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
|
|||||||
subtype = (xmlSchemaTypePtr)
|
subtype = (xmlSchemaTypePtr)
|
||||||
xmlSchemaParseElement(ctxt, schema, child, 0);
|
xmlSchemaParseElement(ctxt, schema, child, 0);
|
||||||
if (subtype != NULL) {
|
if (subtype != NULL) {
|
||||||
|
if (subtype->minOccurs > 1)
|
||||||
|
xmlSchemaPErr(ctxt, child, XML_SCHEMAP_INVALID_MINOCCURS,
|
||||||
|
"invalid value for minOccurs (must be 0 or 1)\n",
|
||||||
|
NULL, NULL);
|
||||||
|
if (subtype->maxOccurs > 1)
|
||||||
|
xmlSchemaPErr(ctxt, child, XML_SCHEMAP_INVALID_MAXOCCURS,
|
||||||
|
"invalid value for maxOccurs (must be 0 or 1)\n",
|
||||||
|
NULL, NULL);
|
||||||
if (last == NULL) {
|
if (last == NULL) {
|
||||||
type->subtypes = subtype;
|
type->subtypes = subtype;
|
||||||
last = subtype;
|
last = subtype;
|
||||||
|
Reference in New Issue
Block a user