| 402 | } |
| 403 | |
| 404 | static void |
| 405 | xmlCtxtDumpString(xmlDebugCtxtPtr ctxt, const xmlChar * str) |
| 406 | { |
| 407 | int i; |
| 408 | |
| 409 | if (ctxt->check) { |
| 410 | return; |
| 411 | } |
| 412 | /* TODO: check UTF8 content of the string */ |
| 413 | if (str == NULL) { |
| 414 | fprintf(ctxt->output, "(NULL)"); |
| 415 | return; |
| 416 | } |
| 417 | for (i = 0; i < 40; i++) |
| 418 | if (str[i] == 0) |
| 419 | return; |
| 420 | else if (IS_BLANK_CH(str[i])) |
| 421 | fputc(' ', ctxt->output); |
| 422 | else if (str[i] >= 0x80) |
| 423 | fprintf(ctxt->output, "#%X", str[i]); |
| 424 | else |
| 425 | fputc(str[i], ctxt->output); |
| 426 | fprintf(ctxt->output, "..."); |
| 427 | } |
| 428 | |
| 429 | static void |
| 430 | xmlCtxtDumpDtdNode(xmlDebugCtxtPtr ctxt, xmlDtdPtr dtd) |
no test coverage detected