MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlReadFile

Function xmlReadFile

ThirdParty/libxml2/vtklibxml2/parser.c:13874–13901  ·  view source on GitHub ↗

* xmlReadFile: * @filename: a file or URL * @encoding: the document encoding (optional) * @options: a combination of xmlParserOption * * Convenience function to parse an XML file from the filesystem, * the network or a global user-define resource loader. * * See xmlCtxtReadFile for details. * * Returns the resulting document tree */

Source from the content-addressed store, hash-verified

13872 * Returns the resulting document tree
13873 */
13874xmlDocPtr
13875xmlReadFile(const char *filename, const char *encoding, int options)
13876{
13877 xmlParserCtxtPtr ctxt;
13878 xmlParserInputPtr input;
13879 xmlDocPtr doc;
13880
13881 ctxt = xmlNewParserCtxt();
13882 if (ctxt == NULL)
13883 return(NULL);
13884
13885 xmlCtxtUseOptions(ctxt, options);
13886
13887 /*
13888 * Backward compatibility for users of command line utilities like
13889 * xmlstarlet expecting "-" to mean stdin. This is dangerous and
13890 * should be removed at some point.
13891 */
13892 if ((filename != NULL) && (filename[0] == '-') && (filename[1] == 0))
13893 input = xmlNewInputFd(ctxt, filename, STDIN_FILENO, encoding, 0);
13894 else
13895 input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0);
13896
13897 doc = xmlCtxtParseDocument(ctxt, input);
13898
13899 xmlFreeParserCtxt(ctxt);
13900 return(doc);
13901}
13902
13903/**
13904 * xmlReadMemory:

Callers 15

RequestDataMethod · 0.85
openFileMethod · 0.85
readSingleNodeMethod · 0.85
xmlconfTestFunction · 0.85
xmlSchematronLoadIncludeFunction · 0.85
xmlSchematronParseFunction · 0.85
mainFunction · 0.85
oldParseTestFunction · 0.85
noentParseTestFunction · 0.85
walkerParseTestFunction · 0.85
xpathDocTestFunction · 0.85
xptrDocTestFunction · 0.85

Calls 6

xmlNewParserCtxtFunction · 0.85
xmlCtxtUseOptionsFunction · 0.85
xmlNewInputFdFunction · 0.85
xmlNewInputURLFunction · 0.85
xmlCtxtParseDocumentFunction · 0.85
xmlFreeParserCtxtFunction · 0.85

Tested by 12

oldParseTestFunction · 0.68
noentParseTestFunction · 0.68
walkerParseTestFunction · 0.68
xpathDocTestFunction · 0.68
xptrDocTestFunction · 0.68
urip_checkURLFunction · 0.68
schemasOneTestFunction · 0.68
rngOneTestFunction · 0.68
patternTestFunction · 0.68
load_xpath_exprFunction · 0.68
c14nRunTestFunction · 0.68
thread_specific_dataFunction · 0.68