| 2359 | } |
| 2360 | |
| 2361 | static void |
| 2362 | parseAndPrintFile(const char *filename, xmlParserCtxtPtr rectxt) { |
| 2363 | xmlDocPtr doc; |
| 2364 | |
| 2365 | if ((timing) && (!repeat)) |
| 2366 | startTimer(); |
| 2367 | |
| 2368 | doc = parseFile(filename, rectxt); |
| 2369 | if (doc == NULL) { |
| 2370 | if (progresult == XMLLINT_RETURN_OK) |
| 2371 | progresult = XMLLINT_ERR_UNCLASS; |
| 2372 | return; |
| 2373 | } |
| 2374 | |
| 2375 | if ((timing) && (!repeat)) { |
| 2376 | endTimer("Parsing"); |
| 2377 | } |
| 2378 | |
| 2379 | if (dropdtd) { |
| 2380 | xmlDtdPtr dtd; |
| 2381 | |
| 2382 | dtd = xmlGetIntSubset(doc); |
| 2383 | if (dtd != NULL) { |
| 2384 | xmlUnlinkNode((xmlNodePtr)dtd); |
| 2385 | doc->intSubset = dtd; |
| 2386 | } |
| 2387 | } |
| 2388 | |
| 2389 | #ifdef LIBXML_XINCLUDE_ENABLED |
| 2390 | if (xinclude) { |
| 2391 | if ((timing) && (!repeat)) { |
| 2392 | startTimer(); |
| 2393 | } |
| 2394 | if (xmlXIncludeProcessFlags(doc, options) < 0) |
| 2395 | progresult = XMLLINT_ERR_UNCLASS; |
| 2396 | if ((timing) && (!repeat)) { |
| 2397 | endTimer("Xinclude processing"); |
| 2398 | } |
| 2399 | } |
| 2400 | #endif |
| 2401 | |
| 2402 | #ifdef LIBXML_XPATH_ENABLED |
| 2403 | if (xpathquery != NULL) { |
| 2404 | doXPathQuery(doc, xpathquery); |
| 2405 | } |
| 2406 | #endif |
| 2407 | |
| 2408 | #ifdef LIBXML_DEBUG_ENABLED |
| 2409 | #ifdef LIBXML_XPATH_ENABLED |
| 2410 | /* |
| 2411 | * shell interaction |
| 2412 | */ |
| 2413 | if (shell) { |
| 2414 | xmlXPathOrderDocElems(doc); |
| 2415 | xmlShell(doc, filename, xmlShellReadline, stdout); |
| 2416 | } |
| 2417 | #endif |
| 2418 | #endif |
no test coverage detected