2 * Summary: the XML document serializer
3 * Description: API to save document or subtree of document
5 * Copy: See Copyright for the status of this software.
7 * Author: Daniel Veillard
8 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
19 #include <stdapis/libxml2/libxml2_xmlio.h>
21 #ifdef LIBXML_OUTPUT_ENABLED
28 #ifdef XMLENGINE_NODEFILTER
31 Pointer to implementation of interface NodeFilter (as introduced in DOM Level 2)
33 @param aNode Node to test
35 1 = KFilterAccept - use node
36 2 = KFilterReject - do not use node but proceed with child nodes
37 3 = KFilterSkip - skip node and its subtree
38 4 = KFilterSkipElementContents - [non-standard option]
40 typedef int (XMLCALL *xmlNodeFilterFunc)(xmlNodePtr aNode);
41 typedef int (XMLCALL *xmlNodeFilterProxyFunc)(void* fn, xmlNodePtr aNode);
43 // Constansts for results that are returned by callbacks of node filter during serialization
44 extern const int KFilterAccept;
45 extern const int KFilterReject;
46 extern const int KFilterSkip;
47 extern const int KFilterSkipElementContents;
49 typedef struct _xmlNodeFilterData xmlNodeFilterData;
52 * xmlSaveTextNodeCallback:
53 * @param context an Save context
54 * @param aNode node to be serialized
56 * Callback used in serializing text nodes
58 * Returns NULL or pointer to string that replaces binary data
60 typedef unsigned char* (*xmlSaveTextNodeCallback) (void * context, xmlNodePtr aNode, int* written);
62 struct _xmlNodeFilterData{
64 xmlNodeFilterProxyFunc proxyFn;
68 typedef struct _xmlSaveCtxt xmlSaveCtxt;
69 typedef xmlSaveCtxt *xmlSaveCtxtPtr;
74 const xmlChar *filename;
75 const xmlChar *encoding;
76 xmlCharEncodingHandlerPtr handler;
77 xmlOutputBufferPtr buf;
83 char indent[MAX_INDENT + 1]; /* array for indenting output */
86 xmlCharEncodingOutputFunc escape; /* used for element content */
87 xmlCharEncodingOutputFunc escapeAttr;/* used for attribute content */
88 xmlSaveTextNodeCallback textNodeCallback;
89 void * context; /* save context */
90 #ifdef XMLENGINE_NODEFILTER
91 xmlNodeFilterData* nodeFilter;
95 XMLPUBFUN xmlSaveCtxtPtr XMLCALL
101 XMLPUBFUN xmlSaveCtxtPtr XMLCALL
103 const char *filename,
104 const char *encoding,
107 XMLPUBFUN xmlSaveCtxtPtr XMLCALL
110 const char *encoding,
113 XMLPUBFUN xmlSaveCtxtPtr XMLCALL
115 xmlOutputWriteCallback iowrite,
116 xmlOutputCloseCallback ioclose,
118 const char *encoding,
121 XMLPUBFUN long XMLCALL
126 XMLPUBFUN long XMLCALL
130 // XMLENGINE: were made exported
131 void xmlNsListDumpOutput(
132 xmlOutputBufferPtr buf,
135 XMLPUBFUN int XMLCALL
137 xmlSaveCtxtPtr ctxt);
139 XMLPUBFUN int XMLCALL
140 xmlSaveClose (xmlSaveCtxtPtr ctxt);
141 XMLPUBFUN int XMLCALL
142 xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
143 xmlCharEncodingOutputFunc escape);
144 XMLPUBFUN int XMLCALL
145 xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
146 xmlCharEncodingOutputFunc escape);
152 #endif /* LIBXML_OUTPUT_ENABLED */
154 #endif /* XML_XMLSAVE_H */