blob: 0f386ab483bea8484c4581c4367b550c4c4b8255 [file] [log] [blame]
Daniel Veillard1a8741c2004-03-04 13:40:59 +00001/*
2 * Summary: the XML document serializer
3 * Description: API to save document or subtree of document
4 *
5 * Copy: See Copyright for the status of this software.
6 *
7 * Author: Daniel Veillard
8 */
9
10#ifndef __XML_XMLSAVE_H__
11#define __XML_XMLSAVE_H__
12
13#include <libxml/xmlversion.h>
14#include <libxml/tree.h>
Daniel Veillard3995bc32004-05-15 18:57:31 +000015#include <libxml/encoding.h>
Daniel Veillard1a8741c2004-03-04 13:40:59 +000016#include <libxml/xmlIO.h>
17
Daniel Veillard2156d432004-03-04 15:59:36 +000018#ifdef LIBXML_OUTPUT_ENABLED
Daniel Veillard1a8741c2004-03-04 13:40:59 +000019#ifdef __cplusplus
20extern "C" {
21#endif
22
Daniel Veillard6fc5db02005-01-16 00:05:58 +000023/**
24 * xmlSaveOption:
25 *
26 * This is the set of XML save options that can be passed down
27 * to the xmlSaveToFd() and similar calls.
28 */
29typedef enum {
Daniel Veillard100e1802005-08-08 14:44:11 +000030 XML_SAVE_FORMAT = 1<<0, /* format save output */
Rob Richards2ce51c02005-09-12 12:16:35 +000031 XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */
32 XML_SAVE_NO_EMPTY = 1<<2 /* no empty tags */
Daniel Veillard6fc5db02005-01-16 00:05:58 +000033} xmlSaveOption;
34
35
Daniel Veillard1a8741c2004-03-04 13:40:59 +000036typedef struct _xmlSaveCtxt xmlSaveCtxt;
37typedef xmlSaveCtxt *xmlSaveCtxtPtr;
38
39XMLPUBFUN xmlSaveCtxtPtr XMLCALL
40 xmlSaveToFd (int fd,
41 const char *encoding,
42 int options);
43XMLPUBFUN xmlSaveCtxtPtr XMLCALL
44 xmlSaveToFilename (const char *filename,
45 const char *encoding,
46 int options);
Daniel Veillarda2351322004-06-27 12:08:10 +000047/******
48 Not yet implemented.
49
Daniel Veillard1a8741c2004-03-04 13:40:59 +000050XMLPUBFUN xmlSaveCtxtPtr XMLCALL
51 xmlSaveToBuffer (xmlBufferPtr buffer,
52 const char *encoding,
53 int options);
Daniel Veillarda2351322004-06-27 12:08:10 +000054 ******/
Daniel Veillard1a8741c2004-03-04 13:40:59 +000055XMLPUBFUN xmlSaveCtxtPtr XMLCALL
56 xmlSaveToIO (xmlOutputWriteCallback iowrite,
57 xmlOutputCloseCallback ioclose,
58 void *ioctx,
59 const char *encoding,
60 int options);
61
62XMLPUBFUN long XMLCALL
63 xmlSaveDoc (xmlSaveCtxtPtr ctxt,
64 xmlDocPtr doc);
65XMLPUBFUN long XMLCALL
66 xmlSaveTree (xmlSaveCtxtPtr ctxt,
67 xmlNodePtr node);
68
69XMLPUBFUN int XMLCALL
70 xmlSaveFlush (xmlSaveCtxtPtr ctxt);
71XMLPUBFUN int XMLCALL
72 xmlSaveClose (xmlSaveCtxtPtr ctxt);
Daniel Veillard3995bc32004-05-15 18:57:31 +000073XMLPUBFUN int XMLCALL
74 xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
75 xmlCharEncodingOutputFunc escape);
76XMLPUBFUN int XMLCALL
77 xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
78 xmlCharEncodingOutputFunc escape);
Daniel Veillard1a8741c2004-03-04 13:40:59 +000079#ifdef __cplusplus
80}
81#endif
Daniel Veillard2156d432004-03-04 15:59:36 +000082#endif /* LIBXML_OUTPUT_ENABLED */
Daniel Veillard1a8741c2004-03-04 13:40:59 +000083#endif /* __XML_XMLSAVE_H__ */
84
85