* xmlReaderForFile: * @filename: a file or URL * @encoding: the document encoding, or NULL * @options: a combination of xmlParserOption * * parse an XML file from the filesystem or the network. * The parsing flags @options are a combination of xmlParserOption. * * Returns the new reader or NULL in case of error. */
| 5160 | * Returns the new reader or NULL in case of error. |
| 5161 | */ |
| 5162 | xmlTextReaderPtr |
| 5163 | xmlReaderForFile(const char *filename, const char *encoding, int options) |
| 5164 | { |
| 5165 | xmlTextReaderPtr reader; |
| 5166 | |
| 5167 | reader = xmlNewTextReaderFilename(filename); |
| 5168 | if (reader == NULL) |
| 5169 | return (NULL); |
| 5170 | if (xmlTextReaderSetup(reader, NULL, NULL, encoding, options) < 0) { |
| 5171 | xmlFreeTextReader(reader); |
| 5172 | return (NULL); |
| 5173 | } |
| 5174 | return (reader); |
| 5175 | } |
| 5176 | |
| 5177 | /** |
| 5178 | * xmlReaderForMemory: |