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

Function xmlSchemaValidateStreamInternal

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:28692–28731  ·  view source on GitHub ↗

* xmlSchemaValidateStreamInternal: * @ctxt: a schema validation context * @pctxt: a parser context * * Returns 0 if the document is schemas valid, a positive error code * number otherwise and -1 in case of internal or API error. */

Source from the content-addressed store, hash-verified

28690 * number otherwise and -1 in case of internal or API error.
28691 */
28692static int
28693xmlSchemaValidateStreamInternal(xmlSchemaValidCtxtPtr ctxt,
28694 xmlParserCtxtPtr pctxt) {
28695 xmlSchemaSAXPlugPtr plug = NULL;
28696 int ret;
28697
28698 pctxt->linenumbers = 1;
28699 xmlSchemaValidateSetLocator(ctxt, xmlSchemaValidateStreamLocator, pctxt);
28700
28701 ctxt->parserCtxt = pctxt;
28702 ctxt->input = pctxt->input->buf;
28703
28704 /*
28705 * Plug the validation and launch the parsing
28706 */
28707 plug = xmlSchemaSAXPlug(ctxt, &(pctxt->sax), &(pctxt->userData));
28708 if (plug == NULL) {
28709 ret = -1;
28710 goto done;
28711 }
28712 ctxt->input = pctxt->input->buf;
28713 ctxt->sax = pctxt->sax;
28714 ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
28715 ret = xmlSchemaVStart(ctxt);
28716
28717 if ((ret == 0) && (! ctxt->parserCtxt->wellFormed)) {
28718 ret = ctxt->parserCtxt->errNo;
28719 if (ret == 0)
28720 ret = 1;
28721 }
28722
28723done:
28724 ctxt->parserCtxt = NULL;
28725 ctxt->sax = NULL;
28726 ctxt->input = NULL;
28727 if (plug != NULL) {
28728 xmlSchemaSAXUnplug(plug);
28729 }
28730 return (ret);
28731}
28732
28733/**
28734 * xmlSchemaValidateStream:

Callers 2

xmlSchemaValidateStreamFunction · 0.85
xmlSchemaValidateFileFunction · 0.85

Calls 4

xmlSchemaSAXPlugFunction · 0.85
xmlSchemaVStartFunction · 0.85
xmlSchemaSAXUnplugFunction · 0.85

Tested by

no test coverage detected