* xmlCreateURLParserCtxt: * @filename: the filename or URL * @options: a combination of xmlParserOption * * DEPRECATED: Use xmlNewParserCtxt and xmlCtxtReadFile. * * Create a parser context for a file or URL content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time and for file accesses * * Returns the new parser context or NUL
| 12772 | * Returns the new parser context or NULL |
| 12773 | */ |
| 12774 | xmlParserCtxtPtr |
| 12775 | xmlCreateURLParserCtxt(const char *filename, int options) |
| 12776 | { |
| 12777 | xmlParserCtxtPtr ctxt; |
| 12778 | xmlParserInputPtr input; |
| 12779 | |
| 12780 | ctxt = xmlNewParserCtxt(); |
| 12781 | if (ctxt == NULL) |
| 12782 | return(NULL); |
| 12783 | |
| 12784 | xmlCtxtUseOptions(ctxt, options); |
| 12785 | ctxt->linenumbers = 1; |
| 12786 | |
| 12787 | input = xmlLoadExternalEntity(filename, NULL, ctxt); |
| 12788 | if (input == NULL) { |
| 12789 | xmlFreeParserCtxt(ctxt); |
| 12790 | return(NULL); |
| 12791 | } |
| 12792 | inputPush(ctxt, input); |
| 12793 | |
| 12794 | return(ctxt); |
| 12795 | } |
| 12796 | |
| 12797 | /** |
| 12798 | * xmlCreateFileParserCtxt: |
no test coverage detected