| 20384 | (((xmlSchemaAttributeGroupPtr) item)->flags & XML_SCHEMAS_ATTRGROUP_REDEFINED) |
| 20385 | |
| 20386 | static int |
| 20387 | xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt) |
| 20388 | { |
| 20389 | int err = 0; |
| 20390 | xmlSchemaRedefPtr redef = WXS_CONSTRUCTOR(pctxt)->redefs; |
| 20391 | xmlSchemaBasicItemPtr prev, item; |
| 20392 | int wasRedefined; |
| 20393 | |
| 20394 | if (redef == NULL) |
| 20395 | return(0); |
| 20396 | |
| 20397 | do { |
| 20398 | item = redef->item; |
| 20399 | /* |
| 20400 | * First try to locate the redefined component in the |
| 20401 | * schema graph starting with the redefined schema. |
| 20402 | * NOTE: According to this schema bug entry: |
| 20403 | * http://lists.w3.org/Archives/Public/www-xml-schema-comments/2005OctDec/0019.html |
| 20404 | * it's not clear if the referenced component needs to originate |
| 20405 | * from the <redefine>d schema _document_ or the schema; the latter |
| 20406 | * would include all imported and included sub-schemas of the |
| 20407 | * <redefine>d schema. Currently the latter approach is used. |
| 20408 | * SUPPLEMENT: It seems that the WG moves towards the latter |
| 20409 | * approach, so we are doing it right. |
| 20410 | * |
| 20411 | */ |
| 20412 | prev = xmlSchemaFindRedefCompInGraph( |
| 20413 | redef->targetBucket, item->type, |
| 20414 | redef->refName, redef->refTargetNs); |
| 20415 | if (prev == NULL) { |
| 20416 | xmlChar *str = NULL; |
| 20417 | xmlNodePtr node; |
| 20418 | |
| 20419 | /* |
| 20420 | * SPEC src-redefine: |
| 20421 | * (6.2.1) "The `actual value` of its own name attribute plus |
| 20422 | * target namespace must successfully `resolve` to a model |
| 20423 | * group definition in I." |
| 20424 | * (7.2.1) "The `actual value` of its own name attribute plus |
| 20425 | * target namespace must successfully `resolve` to an attribute |
| 20426 | * group definition in I." |
| 20427 | |
| 20428 | * |
| 20429 | * Note that, if we are redefining with the use of references |
| 20430 | * to components, the spec assumes the src-resolve to be used; |
| 20431 | * but this won't assure that we search only *inside* the |
| 20432 | * redefined schema. |
| 20433 | */ |
| 20434 | if (redef->reference) |
| 20435 | node = WXS_ITEM_NODE(redef->reference); |
| 20436 | else |
| 20437 | node = WXS_ITEM_NODE(item); |
| 20438 | xmlSchemaCustomErr(ACTXT_CAST pctxt, |
| 20439 | /* |
| 20440 | * TODO: error code. |
| 20441 | * Probably XML_SCHEMAP_SRC_RESOLVE, if this is using the |
| 20442 | * reference kind. |
| 20443 | */ |
no test coverage detected