Commit b15351e5 authored by William M. Brack's avatar William M. Brack
Browse files

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)
parent dc99df93
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>
 
* xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges
......
......@@ -2563,7 +2563,13 @@ xmlSchemaParseAll(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
type->type = XML_SCHEMA_TYPE_ALL;
type->id = xmlSchemaGetProp(ctxt, node, "id");
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);
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;
if (IS_SCHEMA(child, "annotation")) {
......@@ -2574,6 +2580,14 @@ xmlSchemaParseAll(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
subtype = (xmlSchemaTypePtr)
xmlSchemaParseElement(ctxt, schema, child, 0);
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) {
type->subtypes = subtype;
last = subtype;
......
Markdown is supported
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