* htmlCreateFileParserCtxt: * @filename: the filename * @encoding: optional encoding * * DEPRECATED: Use htmlNewParserCtxt and htmlCtxtReadFile. * * Create a parser context to read from a file. * * A non-NULL encoding overrides encoding declarations in the document. * * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * * Ret
| 5904 | * Returns the new parser context or NULL if a memory allocation failed. |
| 5905 | */ |
| 5906 | htmlParserCtxtPtr |
| 5907 | htmlCreateFileParserCtxt(const char *filename, const char *encoding) |
| 5908 | { |
| 5909 | htmlParserCtxtPtr ctxt; |
| 5910 | htmlParserInputPtr input; |
| 5911 | |
| 5912 | if (filename == NULL) |
| 5913 | return(NULL); |
| 5914 | |
| 5915 | ctxt = htmlNewParserCtxt(); |
| 5916 | if (ctxt == NULL) { |
| 5917 | return(NULL); |
| 5918 | } |
| 5919 | |
| 5920 | input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0); |
| 5921 | if (input == NULL) { |
| 5922 | xmlFreeParserCtxt(ctxt); |
| 5923 | return(NULL); |
| 5924 | } |
| 5925 | inputPush(ctxt, input); |
| 5926 | |
| 5927 | return(ctxt); |
| 5928 | } |
| 5929 | |
| 5930 | /** |
| 5931 | * htmlSAXParseFile: |
no test coverage detected