* xmlRelaxNGValidateDefinitionList: * @ctxt: a Relax-NG validation context * @define: the list of definition to verify * * Validate the given node content against the (list) of definitions * * Returns 0 if the validation succeeded or an error code. */
| 9397 | * Returns 0 if the validation succeeded or an error code. |
| 9398 | */ |
| 9399 | static int |
| 9400 | xmlRelaxNGValidateDefinitionList(xmlRelaxNGValidCtxtPtr ctxt, |
| 9401 | xmlRelaxNGDefinePtr defines) |
| 9402 | { |
| 9403 | int ret = 0, res; |
| 9404 | |
| 9405 | |
| 9406 | if (defines == NULL) { |
| 9407 | VALID_ERR2(XML_RELAXNG_ERR_INTERNAL, |
| 9408 | BAD_CAST "NULL definition list"); |
| 9409 | return (-1); |
| 9410 | } |
| 9411 | while (defines != NULL) { |
| 9412 | if ((ctxt->state != NULL) || (ctxt->states != NULL)) { |
| 9413 | res = xmlRelaxNGValidateDefinition(ctxt, defines); |
| 9414 | if (res < 0) |
| 9415 | ret = -1; |
| 9416 | } else { |
| 9417 | VALID_ERR(XML_RELAXNG_ERR_NOSTATE); |
| 9418 | return (-1); |
| 9419 | } |
| 9420 | if (res == -1) /* continues on -2 */ |
| 9421 | break; |
| 9422 | defines = defines->next; |
| 9423 | } |
| 9424 | |
| 9425 | return (ret); |
| 9426 | } |
| 9427 | |
| 9428 | /** |
| 9429 | * xmlRelaxNGElementMatch: |
no test coverage detected