* htmlCtxtReadFile: * @ctxt: an HTML parser context * @filename: a file or URL * @encoding: the document encoding, or NULL * @options: a combination of htmlParserOption(s) * * parse an XML file from the filesystem or the network. * This reuses the existing @ctxt parser context * * Returns the resulting document tree */
| 6183 | * Returns the resulting document tree |
| 6184 | */ |
| 6185 | htmlDocPtr |
| 6186 | htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename, |
| 6187 | const char *encoding, int options) |
| 6188 | { |
| 6189 | xmlParserInputPtr stream; |
| 6190 | |
| 6191 | if (filename == NULL) |
| 6192 | return (NULL); |
| 6193 | if (ctxt == NULL) |
| 6194 | return (NULL); |
| 6195 | |
| 6196 | htmlCtxtReset(ctxt); |
| 6197 | |
| 6198 | stream = xmlLoadExternalEntity(filename, NULL, ctxt); |
| 6199 | if (stream == NULL) { |
| 6200 | return (NULL); |
| 6201 | } |
| 6202 | inputPush(ctxt, stream); |
| 6203 | return (htmlDoRead(ctxt, NULL, encoding, options, 1)); |
| 6204 | } |
| 6205 | |
| 6206 | /** |
| 6207 | * htmlCtxtReadMemory: |