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

Function xmlconfTestNotNSWF

ThirdParty/libxml2/vtklibxml2/runxmlconf.c:238–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238static int
239xmlconfTestNotNSWF(const char *id, const char *filename, int options) {
240 xmlParserCtxtPtr ctxt;
241 xmlDocPtr doc;
242 int ret = 1;
243
244 ctxt = xmlNewParserCtxt();
245 xmlCtxtSetErrorHandler(ctxt, testErrorHandler, NULL);
246 /*
247 * In case of Namespace errors, libxml2 will still parse the document
248 * but log a Namespace error.
249 */
250 doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
251 if (doc == NULL) {
252 test_log("test %s : %s failed to parse the XML\n",
253 id, filename);
254 nb_errors++;
255 ret = 0;
256 } else {
257 const xmlError *error = xmlGetLastError();
258
259 if ((error->code == XML_ERR_OK) ||
260 (error->domain != XML_FROM_NAMESPACE)) {
261 test_log("test %s : %s failed to detect namespace error\n",
262 id, filename);
263 nb_errors++;
264 ret = 0;
265 }
266 xmlFreeDoc(doc);
267 }
268 xmlFreeParserCtxt(ctxt);
269 return(ret);
270}
271
272static int
273xmlconfTestNotWF(const char *id, const char *filename, int options) {

Callers 1

xmlconfTestItemFunction · 0.85

Calls 7

xmlNewParserCtxtFunction · 0.85
xmlCtxtSetErrorHandlerFunction · 0.85
xmlCtxtReadFileFunction · 0.85
xmlGetLastErrorFunction · 0.85
xmlFreeDocFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
test_logFunction · 0.70

Tested by

no test coverage detected