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

Function xmlSchemaValidateFile

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:28811–28831  ·  view source on GitHub ↗

* xmlSchemaValidateFile: * @ctxt: a schema validation context * @filename: the URI of the instance * @options: a future set of options, currently unused * * Do a schemas validation of the given resource, it will use the * SAX streamable validation internally. * * Returns 0 if the document is valid, a positive error code * number otherwise and -1 in case of an internal or API error. *

Source from the content-addressed store, hash-verified

28809 * number otherwise and -1 in case of an internal or API error.
28810 */
28811int
28812xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt,
28813 const char * filename,
28814 int options ATTRIBUTE_UNUSED)
28815{
28816 int ret;
28817 xmlParserCtxtPtr pctxt = NULL;
28818
28819 if ((ctxt == NULL) || (filename == NULL))
28820 return (-1);
28821
28822 pctxt = xmlCreateURLParserCtxt(filename, 0);
28823 if (pctxt == NULL)
28824 return (-1);
28825 /* We really want pctxt->sax to be NULL here. */
28826 xmlFree(pctxt->sax);
28827 pctxt->sax = NULL;
28828 ret = xmlSchemaValidateStreamInternal(ctxt, pctxt);
28829 xmlFreeParserCtxt(pctxt);
28830 return (ret);
28831}
28832
28833/**
28834 * xmlSchemaValidCtxtGetParserCtxt:

Callers 1

schemasOneTestFunction · 0.85

Calls 3

xmlCreateURLParserCtxtFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by 1

schemasOneTestFunction · 0.68