xmlsave.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. } xmlSaveOption;
  31. typedef struct _xmlSaveCtxt xmlSaveCtxt;
  32. typedef xmlSaveCtxt *xmlSaveCtxtPtr;
  33. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  34. xmlSaveToFd (int fd,
  35. const char *encoding,
  36. int options);
  37. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  38. xmlSaveToFilename (const char *filename,
  39. const char *encoding,
  40. int options);
  41. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  42. xmlSaveToBuffer (xmlBufferPtr buffer,
  43. const char *encoding,
  44. int options);
  45. XMLPUBFUN xmlSaveCtxtPtr XMLCALL
  46. xmlSaveToIO (xmlOutputWriteCallback iowrite,
  47. xmlOutputCloseCallback ioclose,
  48. void *ioctx,
  49. const char *encoding,
  50. int options);
  51. XMLPUBFUN long XMLCALL
  52. xmlSaveDoc (xmlSaveCtxtPtr ctxt,
  53. xmlDocPtr doc);
  54. XMLPUBFUN long XMLCALL
  55. xmlSaveTree (xmlSaveCtxtPtr ctxt,
  56. xmlNodePtr node);
  57. XMLPUBFUN int XMLCALL
  58. xmlSaveFlush (xmlSaveCtxtPtr ctxt);
  59. XMLPUBFUN int XMLCALL
  60. xmlSaveClose (xmlSaveCtxtPtr ctxt);
  61. XMLPUBFUN int XMLCALL
  62. xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
  63. xmlCharEncodingOutputFunc escape);
  64. XMLPUBFUN int XMLCALL
  65. xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
  66. xmlCharEncodingOutputFunc escape);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif /* LIBXML_OUTPUT_ENABLED */
  71. #endif /* __XML_XMLSAVE_H__ */