You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.3 KiB

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