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

Function xmlRelaxNGValidateCompiledCallback

ThirdParty/libxml2/vtklibxml2/relaxng.c:7826–7856  ·  view source on GitHub ↗

* xmlRelaxNGValidateCompiledCallback: * @exec: the regular expression instance * @token: the token which matched * @transdata: callback data, the define for the subelement if available @ @inputdata: callback data, the Relax NG validation context * * Handle the callback and if needed validate the element children. */

Source from the content-addressed store, hash-verified

7824 * Handle the callback and if needed validate the element children.
7825 */
7826static void
7827xmlRelaxNGValidateCompiledCallback(xmlRegExecCtxtPtr exec ATTRIBUTE_UNUSED,
7828 const xmlChar * token,
7829 void *transdata, void *inputdata)
7830{
7831 xmlRelaxNGValidCtxtPtr ctxt = (xmlRelaxNGValidCtxtPtr) inputdata;
7832 xmlRelaxNGDefinePtr define = (xmlRelaxNGDefinePtr) transdata;
7833 int ret;
7834
7835 if (ctxt == NULL) {
7836 fprintf(stderr, "callback on %s missing context\n", token);
7837 return;
7838 }
7839 if (define == NULL) {
7840 if (token[0] == '#')
7841 return;
7842 fprintf(stderr, "callback on %s missing define\n", token);
7843 if ((ctxt != NULL) && (ctxt->errNo == XML_RELAXNG_OK))
7844 ctxt->errNo = XML_RELAXNG_ERR_INTERNAL;
7845 return;
7846 }
7847 if (define->type != XML_RELAXNG_ELEMENT) {
7848 fprintf(stderr, "callback on %s define is not element\n", token);
7849 if (ctxt->errNo == XML_RELAXNG_OK)
7850 ctxt->errNo = XML_RELAXNG_ERR_INTERNAL;
7851 return;
7852 }
7853 ret = xmlRelaxNGValidateDefinition(ctxt, define);
7854 if (ret != 0)
7855 ctxt->perr = ret;
7856}
7857
7858/**
7859 * xmlRelaxNGValidateCompiledContent:

Callers

nothing calls this directly

Calls 2

fprintfFunction · 0.85

Tested by

no test coverage detected