|
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 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. |
|
10 */ |
|
11 |
|
12 /** @file |
|
13 @publishedAll |
|
14 @released |
|
15 */ |
|
16 |
|
17 #ifndef HTML_TREE_H |
|
18 #define HTML_TREE_H |
|
19 |
|
20 #include <stdio.h> |
|
21 #include "libxml2_tree.h" |
|
22 #include "libxml2_htmlparser.h" |
|
23 |
|
24 #ifdef __cplusplus |
|
25 extern "C" { |
|
26 #endif |
|
27 |
|
28 /** |
|
29 * HTML_TEXT_NODE: |
|
30 * |
|
31 * Macro. A text node in a HTML document is really implemented |
|
32 * the same way as a text node in an XML document. |
|
33 */ |
|
34 #define HTML_TEXT_NODE XML_TEXT_NODE |
|
35 /** |
|
36 * HTML_ENTITY_REF_NODE: |
|
37 * |
|
38 * Macro. An entity reference in a HTML document is really implemented |
|
39 * the same way as an entity reference in an XML document. |
|
40 */ |
|
41 #define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE |
|
42 /** |
|
43 * HTML_COMMENT_NODE: |
|
44 * |
|
45 * Macro. A comment in a HTML document is really implemented |
|
46 * the same way as a comment in an XML document. |
|
47 */ |
|
48 #define HTML_COMMENT_NODE XML_COMMENT_NODE |
|
49 /** |
|
50 * HTML_PRESERVE_NODE: |
|
51 * |
|
52 * Macro. A preserved node in a HTML document is really implemented |
|
53 * the same way as a CDATA section in an XML document. |
|
54 */ |
|
55 #define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE |
|
56 /** |
|
57 * HTML_PI_NODE: |
|
58 * |
|
59 * Macro. A processing instruction in a HTML document is really implemented |
|
60 * the same way as a processing instruction in an XML document. |
|
61 */ |
|
62 #define HTML_PI_NODE XML_PI_NODE |
|
63 |
|
64 #if defined(LIBXML_HTML_ENABLED) || defined(XMLENGINE_XSLT) |
|
65 |
|
66 XMLPUBFUN htmlDocPtr XMLCALL |
|
67 htmlNewDoc (const xmlChar *URI, |
|
68 const xmlChar *ExternalID); |
|
69 XMLPUBFUN htmlDocPtr XMLCALL |
|
70 htmlNewDocNoDtD (const xmlChar *URI, |
|
71 const xmlChar *ExternalID); |
|
72 XMLPUBFUN int XMLCALL |
|
73 htmlSetMetaEncoding (htmlDocPtr doc, |
|
74 const xmlChar *encoding); |
|
75 |
|
76 #ifdef LIBXML_OUTPUT_ENABLED |
|
77 XMLPUBFUN void XMLCALL |
|
78 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, |
|
79 xmlDocPtr cur, |
|
80 const char *encoding); |
|
81 XMLPUBFUN void XMLCALL |
|
82 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, |
|
83 xmlDocPtr cur, |
|
84 const char *encoding, |
|
85 int format); |
|
86 |
|
87 XMLPUBFUN void XMLCALL |
|
88 htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, |
|
89 xmlDocPtr doc, |
|
90 xmlNodePtr cur, |
|
91 const char *encoding, |
|
92 int format); |
|
93 |
|
94 #endif /* LIBXML_OUTPUT_ENABLED */ |
|
95 |
|
96 XMLPUBFUN int XMLCALL |
|
97 htmlIsBooleanAttr (const xmlChar *name); |
|
98 |
|
99 #endif /* HTML or XSLT */ |
|
100 |
|
101 #ifdef LIBXML_HTML_ENABLED |
|
102 |
|
103 XMLPUBFUN const xmlChar * XMLCALL |
|
104 htmlGetMetaEncoding (htmlDocPtr doc); |
|
105 |
|
106 #ifdef LIBXML_OUTPUT_ENABLED |
|
107 XMLPUBFUN void XMLCALL |
|
108 htmlDocDumpMemory (xmlDocPtr cur, |
|
109 xmlChar **mem, |
|
110 int *size); |
|
111 XMLPUBFUN int XMLCALL |
|
112 htmlDocDump (FILE *f, |
|
113 xmlDocPtr cur); |
|
114 XMLPUBFUN int XMLCALL |
|
115 htmlSaveFile (const char *filename, |
|
116 xmlDocPtr cur); |
|
117 XMLPUBFUN int XMLCALL |
|
118 htmlNodeDump (xmlBufferPtr buf, |
|
119 xmlDocPtr doc, |
|
120 xmlNodePtr cur); |
|
121 XMLPUBFUN void XMLCALL |
|
122 htmlNodeDumpFile (FILE *out, |
|
123 xmlDocPtr doc, |
|
124 xmlNodePtr cur); |
|
125 XMLPUBFUN int XMLCALL |
|
126 htmlNodeDumpFileFormat (FILE *out, |
|
127 xmlDocPtr doc, |
|
128 xmlNodePtr cur, |
|
129 const char *encoding, |
|
130 int format); |
|
131 XMLPUBFUN int XMLCALL |
|
132 htmlSaveFileEnc (const char *filename, |
|
133 xmlDocPtr cur, |
|
134 const char *encoding); |
|
135 XMLPUBFUN int XMLCALL |
|
136 htmlSaveFileFormat (const char *filename, |
|
137 xmlDocPtr cur, |
|
138 const char *encoding, |
|
139 int format); |
|
140 |
|
141 XMLPUBFUN void XMLCALL |
|
142 htmlNodeDumpOutput (xmlOutputBufferPtr buf, |
|
143 xmlDocPtr doc, |
|
144 xmlNodePtr cur, |
|
145 const char *encoding); |
|
146 |
|
147 #endif /* LIBXML_OUTPUT_ENABLED */ |
|
148 #endif /* LIBXML_HTML_ENABLED */ |
|
149 |
|
150 #ifdef __cplusplus |
|
151 } |
|
152 #endif |
|
153 |
|
154 #endif /* HTML_TREE_H */ |