Debian Codegraph @

include/libxml/xmlsave.h

raw
1 /**
2 * @file
3 *
4 * @brief XML/HTML serializer
5 *
6 * API to save documents or subtrees of documents.
7 *
8 * @copyright See Copyright for the status of this software.
9 *
10 * @author Daniel Veillard
11 */
12
13 #ifndef __XML_XMLSAVE_H__
14 #define __XML_XMLSAVE_H__
15
16 #include <libxml/xmlversion.h>
17 #include <libxml/tree.h>
18 #include <libxml/encoding.h>
19 #include <libxml/xmlIO.h>
20
21 #ifdef LIBXML_OUTPUT_ENABLED
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27 * This is the set of XML save options that can be passed down
28 * to the #xmlSaveToFd and similar calls.
29 */
30 typedef enum {
31 /**
32 * Format output. This adds newlines and enables indenting
33 * by default.
34 */
35 XML_SAVE_FORMAT = 1<<0,
36 /**
37 * Don't emit an XML declaration.
38 */
39 XML_SAVE_NO_DECL = 1<<1,
40 /**
41 * Don't emit empty tags.
42 */
43 XML_SAVE_NO_EMPTY = 1<<2,
44 /**
45 * Don't serialize as XHTML.
46 */
47 XML_SAVE_NO_XHTML = 1<<3,
48 /**
49 * Always serialize as XHTML.
50 */
51 XML_SAVE_XHTML = 1<<4,
52 /**
53 * Serialize HTML documents as XML.
54 */
55 XML_SAVE_AS_XML = 1<<5,
56 /**
57 * Serialize XML documents as HTML.
58 */
59 XML_SAVE_AS_HTML = 1<<6,
60 /**
61 * Format with non-significant whitespace.
62 * TODO: What does this mean?
63 */
64 XML_SAVE_WSNONSIG = 1<<7,
65 /**
66 * Always emit empty tags. This is the default unless the
67 * deprecated thread-local setting xmlSaveNoEmptyTags is
68 * set to 1.
69 *
70 * @since 2.14
71 */
72 XML_SAVE_EMPTY = 1<<8,
73 /**
74 * Don't indent output when formatting.
75 *
76 * @since 2.14
77 */
78 XML_SAVE_NO_INDENT = 1<<9,
79 /**
80 * Always indent output when formatting. This is the default
81 * unless the deprecated thread-local setting
82 * xmlIndentTreeOutput is set to 0.
83 *
84 * @since 2.14
85 */
86 XML_SAVE_INDENT = 1<<10
87 } xmlSaveOption;
88
89 /** XML and HTML serializer */
90 typedef struct _xmlSaveCtxt xmlSaveCtxt;
91 typedef xmlSaveCtxt *xmlSaveCtxtPtr;
92
93 XMLPUBFUN xmlSaveCtxt *
94 xmlSaveToFd (int fd,
95 const char *encoding,
96 int options);
97 XMLPUBFUN xmlSaveCtxt *
98 xmlSaveToFilename (const char *filename,
99 const char *encoding,
100 int options);
101
102 XMLPUBFUN xmlSaveCtxt *
103 xmlSaveToBuffer (xmlBuffer *buffer,
104 const char *encoding,
105 int options);
106
107 XMLPUBFUN xmlSaveCtxt *
108 xmlSaveToIO (xmlOutputWriteCallback iowrite,
109 xmlOutputCloseCallback ioclose,
110 void *ioctx,
111 const char *encoding,
112 int options);
113
114 XMLPUBFUN long
115 xmlSaveDoc (xmlSaveCtxt *ctxt,
116 xmlDoc *doc);
117 XMLPUBFUN long
118 xmlSaveTree (xmlSaveCtxt *ctxt,
119 xmlNode *node);
120
121 XMLPUBFUN int
122 xmlSaveFlush (xmlSaveCtxt *ctxt);
123 XMLPUBFUN int
124 xmlSaveClose (xmlSaveCtxt *ctxt);
125 XMLPUBFUN xmlParserErrors
126 xmlSaveFinish (xmlSaveCtxt *ctxt);
127 XMLPUBFUN int
128 xmlSaveSetIndentString (xmlSaveCtxt *ctxt,
129 const char *indent);
130 XML_DEPRECATED
131 XMLPUBFUN int
132 xmlSaveSetEscape (xmlSaveCtxt *ctxt,
133 xmlCharEncodingOutputFunc escape);
134 XML_DEPRECATED
135 XMLPUBFUN int
136 xmlSaveSetAttrEscape (xmlSaveCtxt *ctxt,
137 xmlCharEncodingOutputFunc escape);
138
139 XML_DEPRECATED
140 XMLPUBFUN int
141 xmlThrDefIndentTreeOutput(int v);
142 XML_DEPRECATED
143 XMLPUBFUN const char *
144 xmlThrDefTreeIndentString(const char * v);
145 XML_DEPRECATED
146 XMLPUBFUN int
147 xmlThrDefSaveNoEmptyTags(int v);
148
149 #ifdef __cplusplus
150 }
151 #endif
152
153 #endif /* LIBXML_OUTPUT_ENABLED */
154 #endif /* __XML_XMLSAVE_H__ */
155
156