xmlsave.h 2.5 KB

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