* xmlReadDoc: * @cur: a pointer to a zero terminated string * @URL: base URL (optional) * @encoding: the document encoding (optional) * @options: a combination of xmlParserOption * * Convenience function to parse an XML document from a * zero-terminated string. * * See xmlCtxtReadDoc for details. * * Returns the resulting document tree */
| 13836 | * Returns the resulting document tree |
| 13837 | */ |
| 13838 | xmlDocPtr |
| 13839 | xmlReadDoc(const xmlChar *cur, const char *URL, const char *encoding, |
| 13840 | int options) |
| 13841 | { |
| 13842 | xmlParserCtxtPtr ctxt; |
| 13843 | xmlParserInputPtr input; |
| 13844 | xmlDocPtr doc; |
| 13845 | |
| 13846 | ctxt = xmlNewParserCtxt(); |
| 13847 | if (ctxt == NULL) |
| 13848 | return(NULL); |
| 13849 | |
| 13850 | xmlCtxtUseOptions(ctxt, options); |
| 13851 | |
| 13852 | input = xmlNewInputString(ctxt, URL, (const char *) cur, encoding, |
| 13853 | XML_INPUT_BUF_STATIC); |
| 13854 | |
| 13855 | doc = xmlCtxtParseDocument(ctxt, input); |
| 13856 | |
| 13857 | xmlFreeParserCtxt(ctxt); |
| 13858 | return(doc); |
| 13859 | } |
| 13860 | |
| 13861 | /** |
| 13862 | * xmlReadFile: |
nothing calls this directly
no test coverage detected