* htmlDtdDumpOutput: * @buf: the HTML buffer output * @doc: the document * @encoding: the encoding string * * TODO: check whether encoding is needed * * Dump the HTML document DTD, if any. */
| 615 | * Dump the HTML document DTD, if any. |
| 616 | */ |
| 617 | static void |
| 618 | htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, |
| 619 | const char *encoding ATTRIBUTE_UNUSED) { |
| 620 | xmlDtdPtr cur = doc->intSubset; |
| 621 | |
| 622 | if (cur == NULL) { |
| 623 | htmlSaveErr(XML_SAVE_NO_DOCTYPE, (xmlNodePtr) doc, NULL); |
| 624 | return; |
| 625 | } |
| 626 | xmlOutputBufferWriteString(buf, "<!DOCTYPE "); |
| 627 | xmlOutputBufferWriteString(buf, (const char *)cur->name); |
| 628 | if (cur->ExternalID != NULL) { |
| 629 | xmlOutputBufferWriteString(buf, " PUBLIC "); |
| 630 | xmlOutputBufferWriteQuotedString(buf, cur->ExternalID); |
| 631 | if (cur->SystemID != NULL) { |
| 632 | xmlOutputBufferWriteString(buf, " "); |
| 633 | xmlOutputBufferWriteQuotedString(buf, cur->SystemID); |
| 634 | } |
| 635 | } else if (cur->SystemID != NULL && |
| 636 | xmlStrcmp(cur->SystemID, BAD_CAST "about:legacy-compat")) { |
| 637 | xmlOutputBufferWriteString(buf, " SYSTEM "); |
| 638 | xmlOutputBufferWriteQuotedString(buf, cur->SystemID); |
| 639 | } |
| 640 | xmlOutputBufferWriteString(buf, ">\n"); |
| 641 | } |
| 642 | |
| 643 | /** |
| 644 | * htmlAttrDumpOutput: |
no test coverage detected