xmlsave.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  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. #ifndef __XML_XMLSAVE_H__
  10. #define __XML_XMLSAVE_H__
  11. #include <libxml/xmlversion.h>
  12. #include <libxml/tree.h>
  13. #include <libxml/encoding.h>
  14. #include <libxml/xmlIO.h>
  15. #ifdef LIBXML_OUTPUT_ENABLED
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * xmlSaveOption:
  21. *
  22. * This is the set of XML save options that can be passed down
  23. * to the xmlSaveToFd() and similar calls.
  24. */
  25. typedef enum {
  26. XML_SAVE_FORMAT = 1<<0, /* format save output */
  27. XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */
  28. XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */
  29. XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
  30. XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
  31. XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
  32. XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */
  33. } xmlSaveOption;
  34. typedef struct _xmlSaveCtxt xmlSaveCtxt;
  35. typedef xmlSaveCtxt *xmlSaveCtxtPtr;
  36. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  37. xmlSaveToFd (int fd,
  38. const char *encoding,
  39. int options);
  40. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  41. xmlSaveToFilename (const char *filename,
  42. const char *encoding,
  43. int options);
  44. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  45. xmlSaveToBuffer (xmlBufferPtr buffer,
  46. const char *encoding,
  47. int options);
  48. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  49. xmlSaveToIO (xmlOutputWriteCallback iowrite,
  50. xmlOutputCloseCallback ioclose,
  51. void *ioctx,
  52. const char *encoding,
  53. int options);
  54. XMLPUBFUN long XMLCALL
  55. xmlSaveDoc (xmlSaveCtxtPtr ctxt,
  56. xmlDocPtr doc);
  57. XMLPUBFUN long XMLCALL
  58. xmlSaveTree (xmlSaveCtxtPtr ctxt,
  59. xmlNodePtr node);
  60. XMLPUBFUN int XMLCALL
  61. xmlSaveFlush (xmlSaveCtxtPtr ctxt);
  62. XMLPUBFUN int XMLCALL
  63. xmlSaveClose (xmlSaveCtxtPtr ctxt);
  64. XMLPUBFUN int XMLCALL
  65. xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
  66. xmlCharEncodingOutputFunc escape);
  67. XMLPUBFUN int XMLCALL
  68. xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
  69. xmlCharEncodingOutputFunc escape);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* LIBXML_OUTPUT_ENABLED */
  74. #endif /* __XML_XMLSAVE_H__ */