* htmlReadFile: * @filename: a file or URL * @encoding: the document encoding (optional) * @options: a combination of htmlParserOptions * * Convenience function to parse an HTML file from the filesystem, * the network or a global user-defined resource loader. * * See htmlCtxtReadFile for details. * * Returns the resulting document tree. */
| 6402 | * Returns the resulting document tree. |
| 6403 | */ |
| 6404 | htmlDocPtr |
| 6405 | htmlReadFile(const char *filename, const char *encoding, int options) |
| 6406 | { |
| 6407 | htmlParserCtxtPtr ctxt; |
| 6408 | xmlParserInputPtr input; |
| 6409 | htmlDocPtr doc; |
| 6410 | |
| 6411 | ctxt = htmlNewParserCtxt(); |
| 6412 | if (ctxt == NULL) |
| 6413 | return(NULL); |
| 6414 | |
| 6415 | htmlCtxtUseOptions(ctxt, options); |
| 6416 | |
| 6417 | input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0); |
| 6418 | |
| 6419 | doc = htmlCtxtParseDocument(ctxt, input); |
| 6420 | |
| 6421 | htmlFreeParserCtxt(ctxt); |
| 6422 | return(doc); |
| 6423 | } |
| 6424 | |
| 6425 | /** |
| 6426 | * htmlReadMemory: |
no test coverage detected