* xmlSchemaAddModelGroupDefinition: * @ctxt: a schema validation context * @schema: the schema being built * @name: the group name * * Add an XML schema Group definition * * Returns the new structure or NULL in case of error */
| 5504 | * Returns the new structure or NULL in case of error |
| 5505 | */ |
| 5506 | static xmlSchemaModelGroupDefPtr |
| 5507 | xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt, |
| 5508 | xmlSchemaPtr schema, |
| 5509 | const xmlChar *name, |
| 5510 | const xmlChar *nsName, |
| 5511 | xmlNodePtr node) |
| 5512 | { |
| 5513 | xmlSchemaModelGroupDefPtr ret = NULL; |
| 5514 | |
| 5515 | if ((ctxt == NULL) || (schema == NULL) || (name == NULL)) |
| 5516 | return (NULL); |
| 5517 | |
| 5518 | ret = (xmlSchemaModelGroupDefPtr) |
| 5519 | xmlMalloc(sizeof(xmlSchemaModelGroupDef)); |
| 5520 | if (ret == NULL) { |
| 5521 | xmlSchemaPErrMemory(ctxt); |
| 5522 | return (NULL); |
| 5523 | } |
| 5524 | memset(ret, 0, sizeof(xmlSchemaModelGroupDef)); |
| 5525 | ret->name = name; |
| 5526 | ret->type = XML_SCHEMA_TYPE_GROUP; |
| 5527 | ret->node = node; |
| 5528 | ret->targetNamespace = nsName; |
| 5529 | |
| 5530 | if (ctxt->isRedefine) { |
| 5531 | ctxt->redef = xmlSchemaAddRedef(ctxt, ctxt->redefined, |
| 5532 | ret, name, nsName); |
| 5533 | if (ctxt->redef == NULL) { |
| 5534 | xmlFree(ret); |
| 5535 | return(NULL); |
| 5536 | } |
| 5537 | ctxt->redefCounter = 0; |
| 5538 | } |
| 5539 | WXS_ADD_GLOBAL(ctxt, ret); |
| 5540 | WXS_ADD_PENDING(ctxt, ret); |
| 5541 | return (ret); |
| 5542 | } |
| 5543 | |
| 5544 | /** |
| 5545 | * xmlSchemaNewWildcardNs: |
no test coverage detected