  
    
    
    
    
    
    
    
  
  
    
      
        
          
libxml2-xmlregexp.html            
Prev          
        
        
          
general.html            
Up          
        
        
          
index.html            
Home          
        
        
          
libxml2-xmlschemas.html            
Next          
        
        
libxml2 Reference Manual      
    
    
      
xmlsave    
    
xmlsave - the XML document serializer
    
API to save document or subtree of document 
    
Author(s): Daniel Veillard 
    
      
Synopsis
      
typedef enum #xmlSaveOptionxmlSaveOption ;
typedef struct _xmlSaveCtxt 
#xmlSaveCtxtxmlSaveCtxt ;
typedef 
libxml2-xmlsave.html#xmlSaveCtxtxmlSaveCtxt  * #xmlSaveCtxtPtrxmlSaveCtxtPtr ;
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	#xmlSaveToIOxmlSaveToIO 		( libxml2-xmlIO.html#xmlOutputWriteCallbackxmlOutputWriteCallback  iowrite, 					 libxml2-xmlIO.html#xmlOutputCloseCallbackxmlOutputCloseCallback  ioclose, 					 void * ioctx, 					 const char * encoding, 					 int options);
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	#xmlSaveToFdxmlSaveToFd 		(int fd, 					 const char * encoding, 					 int options);
int	
#xmlSaveClosexmlSaveClose 			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt);
int	
#xmlSaveSetAttrEscapexmlSaveSetAttrEscape 		( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-encoding.html#xmlCharEncodingOutputFuncxmlCharEncodingOutputFunc  escape);
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	#xmlSaveToBufferxmlSaveToBuffer 		( libxml2-tree.html#xmlBufferPtrxmlBufferPtr  buffer, 					 const char * encoding, 					 int options);
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	#xmlSaveToFilenamexmlSaveToFilename 	(const char * filename, 					 const char * encoding, 					 int options);
int	
#xmlSaveFlushxmlSaveFlush 			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt);
long	
#xmlSaveDocxmlSaveDoc 			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc);
int	
#xmlSaveSetEscapexmlSaveSetEscape 		( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-encoding.html#xmlCharEncodingOutputFuncxmlCharEncodingOutputFunc  escape);
long	
#xmlSaveTreexmlSaveTree 			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node);
    
    
      
Description
    
    
      
Details
      
        
Structure xmlSaveCtxt
struct _xmlSaveCtxt {
The content of this structure is not made public by the API.
} xmlSaveCtxt;
        
        
Typedef xmlSaveCtxtPtr
libxml2-xmlsave.html#xmlSaveCtxtxmlSaveCtxt  * xmlSaveCtxtPtr;
        
        
Enum xmlSaveOption
enum #xmlSaveOptionxmlSaveOption  {
    
XML_SAVE_FORMAT  = 1 /* format save output */
    
XML_SAVE_NO_DECL  = 2 /* drop the xml declaration */
    
XML_SAVE_NO_EMPTY  = 4 /* no empty tags */
    
XML_SAVE_NO_XHTML  = 8 /*  disable XHTML1 specific rules */
};
        
        
xmlSaveClose ()
int	xmlSaveClose			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt)Close a document saving context, i.e. make sure that all bytes have been output and free the associated data.
ctxt: a document saving context Returns: the number of byte written or -1 in case of error.         
        
xmlSaveDoc ()
long	xmlSaveDoc			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc)Save a full document to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead
ctxt: a document saving context doc: a document Returns: the number of byte written or -1 in case of error         
        
xmlSaveFlush ()
int	xmlSaveFlush			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt)Flush a document saving context, i.e. make sure that all bytes have been output.
ctxt: a document saving context Returns: the number of byte written or -1 in case of error.         
        
xmlSaveSetAttrEscape ()
int	xmlSaveSetAttrEscape		( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-encoding.html#xmlCharEncodingOutputFuncxmlCharEncodingOutputFunc  escape)Set a custom escaping function to be used for text in libxml2-SAX.html#attributeattribute  content
ctxt: a document saving context escape: the escaping function Returns: 0 if successful or -1 in case of error.         
        
xmlSaveSetEscape ()
int	xmlSaveSetEscape		( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-encoding.html#xmlCharEncodingOutputFuncxmlCharEncodingOutputFunc  escape)Set a custom escaping function to be used for text in element content
ctxt: a document saving context escape: the escaping function Returns: 0 if successful or -1 in case of error.         
        
xmlSaveToBuffer ()
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	xmlSaveToBuffer		( libxml2-tree.html#xmlBufferPtrxmlBufferPtr  buffer, 					 const char * encoding, 					 int options)Create a document saving context serializing to a buffer with the encoding and the options given
buffer: a buffer encoding: the encoding name to use or NULL options: a set of xmlSaveOptions Returns: a new serialization context or NULL in case of error.         
        
xmlSaveToFd ()
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	xmlSaveToFd		(int fd, 					 const char * encoding, 					 int options)Create a document saving context serializing to a file descriptor with the encoding and the options given.
fd: a file descriptor number encoding: the encoding name to use or NULL options: a set of xmlSaveOptions Returns: a new serialization context or NULL in case of error.         
        
xmlSaveToFilename ()
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	xmlSaveToFilename	(const char * filename, 					 const char * encoding, 					 int options)Create a document saving context serializing to a filename or possibly to an URL (but this is less reliable) with the encoding and the options given.
filename: a file name or an URL encoding: the encoding name to use or NULL options: a set of xmlSaveOptions Returns: a new serialization context or NULL in case of error.         
        
xmlSaveToIO ()
libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr 	xmlSaveToIO		( libxml2-xmlIO.html#xmlOutputWriteCallbackxmlOutputWriteCallback  iowrite, 					 libxml2-xmlIO.html#xmlOutputCloseCallbackxmlOutputCloseCallback  ioclose, 					 void * ioctx, 					 const char * encoding, 					 int options)Create a document saving context serializing to a file descriptor with the encoding and the options given
iowrite: an I/O write function ioclose: an I/O close function ioctx: an I/O handler encoding: the encoding name to use or NULL options: a set of xmlSaveOptions Returns: a new serialization context or NULL in case of error.         
        
xmlSaveTree ()
long	xmlSaveTree			( libxml2-xmlsave.html#xmlSaveCtxtPtrxmlSaveCtxtPtr  ctxt, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node)Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead
ctxt: a document saving context node: a document Returns: the number of byte written or -1 in case of error         
      
    
  
