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

Function xmlParseCatalogFile

ThirdParty/libxml2/vtklibxml2/catalog.c:861–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859 */
860
861xmlDocPtr
862xmlParseCatalogFile(const char *filename) {
863 xmlDocPtr ret;
864 xmlParserCtxtPtr ctxt;
865 xmlParserInputPtr inputStream;
866 xmlParserInputBufferPtr buf;
867
868 ctxt = xmlNewParserCtxt();
869 if (ctxt == NULL) {
870 xmlCatalogErrMemory();
871 return(NULL);
872 }
873
874 buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE);
875 if (buf == NULL) {
876 xmlFreeParserCtxt(ctxt);
877 return(NULL);
878 }
879
880 inputStream = xmlNewInputStream(ctxt);
881 if (inputStream == NULL) {
882 xmlFreeParserInputBuffer(buf);
883 xmlFreeParserCtxt(ctxt);
884 return(NULL);
885 }
886
887 inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename);
888 inputStream->buf = buf;
889 xmlBufResetInput(buf->buffer, inputStream);
890
891 inputPush(ctxt, inputStream);
892
893 ctxt->valid = 0;
894 ctxt->validate = 0;
895 ctxt->loadsubset = 0;
896 ctxt->pedantic = 0;
897 ctxt->dictNames = 1;
898
899 xmlParseDocument(ctxt);
900
901 if (ctxt->wellFormed)
902 ret = ctxt->myDoc;
903 else {
904 ret = NULL;
905 xmlFreeDoc(ctxt->myDoc);
906 ctxt->myDoc = NULL;
907 }
908 xmlFreeParserCtxt(ctxt);
909
910 return(ret);
911}
912
913/**
914 * xmlLoadFileContent:

Callers 1

xmlParseXMLCatalogFileFunction · 0.85

Calls 11

xmlNewParserCtxtFunction · 0.85
xmlCatalogErrMemoryFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
xmlNewInputStreamFunction · 0.85
xmlFreeParserInputBufferFunction · 0.85
xmlCanonicPathFunction · 0.85
xmlBufResetInputFunction · 0.85
inputPushFunction · 0.85
xmlParseDocumentFunction · 0.85
xmlFreeDocFunction · 0.85

Tested by

no test coverage detected