MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlRelaxNGValidateDefinitionList

Function xmlRelaxNGValidateDefinitionList

ThirdParty/libxml2/vtklibxml2/relaxng.c:9399–9426  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

9397 * Returns 0 if the validation succeeded or an error code.
9398 */
9399static int
9400xmlRelaxNGValidateDefinitionList(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:

Callers 1

xmlRelaxNGValidateStateFunction · 0.85

Calls 1

Tested by

no test coverage detected