* 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. *
| 28809 | * number otherwise and -1 in case of an internal or API error. |
| 28810 | */ |
| 28811 | int |
| 28812 | xmlSchemaValidateFile(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: |