2004-03-04 13:40:59 +00:00
/*
* Summary : the XML document serializer
* Description : API to save document or subtree of document
*
* Copy : See Copyright for the status of this software .
*
* Author : Daniel Veillard
*/
# ifndef __XML_XMLSAVE_H__
# define __XML_XMLSAVE_H__
# include <libxml/xmlversion.h>
# include <libxml/tree.h>
2004-05-15 18:57:31 +00:00
# include <libxml/encoding.h>
2004-03-04 13:40:59 +00:00
# include <libxml/xmlIO.h>
2004-03-04 15:59:36 +00:00
# ifdef LIBXML_OUTPUT_ENABLED
2004-03-04 13:40:59 +00:00
# ifdef __cplusplus
extern " C " {
# endif
2005-01-16 00:05:58 +00:00
/**
* xmlSaveOption :
*
* This is the set of XML save options that can be passed down
* to the xmlSaveToFd ( ) and similar calls .
*/
typedef enum {
2005-08-08 14:44:11 +00:00
XML_SAVE_FORMAT = 1 < < 0 , /* format save output */
2005-09-12 12:16:35 +00:00
XML_SAVE_NO_DECL = 1 < < 1 , /* drop the xml declaration */
2005-09-12 21:43:20 +00:00
XML_SAVE_NO_EMPTY = 1 < < 2 , /* no empty tags */
2008-09-25 14:31:40 +00:00
XML_SAVE_NO_XHTML = 1 < < 3 , /* disable XHTML1 specific rules */
XML_SAVE_XHTML = 1 < < 4 , /* force XHTML1 specific rules */
XML_SAVE_AS_XML = 1 < < 5 , /* force XML serialization on HTML doc */
2010-11-03 15:33:40 +01:00
XML_SAVE_AS_HTML = 1 < < 6 , /* force HTML serialization on XML doc */
XML_SAVE_WSNONSIG = 1 < < 7 /* format with non-significant whitespace */
2005-01-16 00:05:58 +00:00
} xmlSaveOption ;
2004-03-04 13:40:59 +00:00
typedef struct _xmlSaveCtxt xmlSaveCtxt ;
typedef xmlSaveCtxt * xmlSaveCtxtPtr ;
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
xmlSaveToFd ( int fd ,
const char * encoding ,
int options ) ;
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
xmlSaveToFilename ( const char * filename ,
const char * encoding ,
int options ) ;
2004-06-27 12:08:10 +00:00
2004-03-04 13:40:59 +00:00
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
xmlSaveToBuffer ( xmlBufferPtr buffer ,
const char * encoding ,
int options ) ;
2005-11-09 08:56:26 +00:00
2004-03-04 13:40:59 +00:00
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
xmlSaveToIO ( xmlOutputWriteCallback iowrite ,
xmlOutputCloseCallback ioclose ,
void * ioctx ,
const char * encoding ,
int options ) ;
XMLPUBFUN long XMLCALL
xmlSaveDoc ( xmlSaveCtxtPtr ctxt ,
xmlDocPtr doc ) ;
XMLPUBFUN long XMLCALL
xmlSaveTree ( xmlSaveCtxtPtr ctxt ,
xmlNodePtr node ) ;
XMLPUBFUN int XMLCALL
xmlSaveFlush ( xmlSaveCtxtPtr ctxt ) ;
XMLPUBFUN int XMLCALL
xmlSaveClose ( xmlSaveCtxtPtr ctxt ) ;
2004-05-15 18:57:31 +00:00
XMLPUBFUN int XMLCALL
xmlSaveSetEscape ( xmlSaveCtxtPtr ctxt ,
xmlCharEncodingOutputFunc escape ) ;
XMLPUBFUN int XMLCALL
xmlSaveSetAttrEscape ( xmlSaveCtxtPtr ctxt ,
xmlCharEncodingOutputFunc escape ) ;
2004-03-04 13:40:59 +00:00
# ifdef __cplusplus
}
# endif
2004-03-04 15:59:36 +00:00
# endif /* LIBXML_OUTPUT_ENABLED */
2004-03-04 13:40:59 +00:00
# endif /* __XML_XMLSAVE_H__ */