HTMLtree.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Summary: specific APIs to process HTML tree, especially serialization
  3. * Description: this module implements a few function needed to process
  4. * tree in an HTML specific way.
  5. *
  6. * Copy: See Copyright for the status of this software.
  7. *
  8. * Author: Daniel Veillard
  9. */
  10. #ifndef __HTML_TREE_H__
  11. #define __HTML_TREE_H__
  12. #include <stdio.h>
  13. #include <libxml/xmlversion.h>
  14. #include <libxml/tree.h>
  15. #include <libxml/HTMLparser.h>
  16. #ifdef LIBXML_HTML_ENABLED
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /**
  21. * HTML_TEXT_NODE:
  22. *
  23. * Macro. A text node in a HTML document is really implemented
  24. * the same way as a text node in an XML document.
  25. */
  26. #define HTML_TEXT_NODE XML_TEXT_NODE
  27. /**
  28. * HTML_ENTITY_REF_NODE:
  29. *
  30. * Macro. An entity reference in a HTML document is really implemented
  31. * the same way as an entity reference in an XML document.
  32. */
  33. #define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE
  34. /**
  35. * HTML_COMMENT_NODE:
  36. *
  37. * Macro. A comment in a HTML document is really implemented
  38. * the same way as a comment in an XML document.
  39. */
  40. #define HTML_COMMENT_NODE XML_COMMENT_NODE
  41. /**
  42. * HTML_PRESERVE_NODE:
  43. *
  44. * Macro. A preserved node in a HTML document is really implemented
  45. * the same way as a CDATA section in an XML document.
  46. */
  47. #define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE
  48. /**
  49. * HTML_PI_NODE:
  50. *
  51. * Macro. A processing instruction in a HTML document is really implemented
  52. * the same way as a processing instruction in an XML document.
  53. */
  54. #define HTML_PI_NODE XML_PI_NODE
  55. XMLPUBFUN htmlDocPtr XMLCALL
  56. htmlNewDoc (const xmlChar *URI,
  57. const xmlChar *ExternalID);
  58. XMLPUBFUN htmlDocPtr XMLCALL
  59. htmlNewDocNoDtD (const xmlChar *URI,
  60. const xmlChar *ExternalID);
  61. XMLPUBFUN const xmlChar * XMLCALL
  62. htmlGetMetaEncoding (htmlDocPtr doc);
  63. XMLPUBFUN int XMLCALL
  64. htmlSetMetaEncoding (htmlDocPtr doc,
  65. const xmlChar *encoding);
  66. #ifdef LIBXML_OUTPUT_ENABLED
  67. XMLPUBFUN void XMLCALL
  68. htmlDocDumpMemory (xmlDocPtr cur,
  69. xmlChar **mem,
  70. int *size);
  71. XMLPUBFUN void XMLCALL
  72. htmlDocDumpMemoryFormat (xmlDocPtr cur,
  73. xmlChar **mem,
  74. int *size,
  75. int format);
  76. XMLPUBFUN int XMLCALL
  77. htmlDocDump (FILE *f,
  78. xmlDocPtr cur);
  79. XMLPUBFUN int XMLCALL
  80. htmlSaveFile (const char *filename,
  81. xmlDocPtr cur);
  82. XMLPUBFUN int XMLCALL
  83. htmlNodeDump (xmlBufferPtr buf,
  84. xmlDocPtr doc,
  85. xmlNodePtr cur);
  86. XMLPUBFUN void XMLCALL
  87. htmlNodeDumpFile (FILE *out,
  88. xmlDocPtr doc,
  89. xmlNodePtr cur);
  90. XMLPUBFUN int XMLCALL
  91. htmlNodeDumpFileFormat (FILE *out,
  92. xmlDocPtr doc,
  93. xmlNodePtr cur,
  94. const char *encoding,
  95. int format);
  96. XMLPUBFUN int XMLCALL
  97. htmlSaveFileEnc (const char *filename,
  98. xmlDocPtr cur,
  99. const char *encoding);
  100. XMLPUBFUN int XMLCALL
  101. htmlSaveFileFormat (const char *filename,
  102. xmlDocPtr cur,
  103. const char *encoding,
  104. int format);
  105. XMLPUBFUN void XMLCALL
  106. htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
  107. xmlDocPtr doc,
  108. xmlNodePtr cur,
  109. const char *encoding,
  110. int format);
  111. XMLPUBFUN void XMLCALL
  112. htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
  113. xmlDocPtr cur,
  114. const char *encoding);
  115. XMLPUBFUN void XMLCALL
  116. htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
  117. xmlDocPtr cur,
  118. const char *encoding,
  119. int format);
  120. XMLPUBFUN void XMLCALL
  121. htmlNodeDumpOutput (xmlOutputBufferPtr buf,
  122. xmlDocPtr doc,
  123. xmlNodePtr cur,
  124. const char *encoding);
  125. #endif /* LIBXML_OUTPUT_ENABLED */
  126. XMLPUBFUN int XMLCALL
  127. htmlIsBooleanAttr (const xmlChar *name);
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif /* LIBXML_HTML_ENABLED */
  132. #endif /* __HTML_TREE_H__ */