Back to Turicreate

Module xmlsave from libxml2

deps/src/libxml2-2.9.1/doc/html/libxml-xmlsave.html

6.4.18.7 KB
Original Source

| |

|

|

|

Module xmlsave from libxml2

|

|

|

|

|

|

| API Menu | |

|

| API Indexes | |

|

| Related links | |

|

|

|

|

|

|

| | xmlregexp | | API documentation | | The XML C parser and toolkit of Gnome | xmlschemas | |

API to save document or subtree of document

Table of Contents

Structure[xmlSaveCtxt](#xmlSaveCtxt)
struct _xmlSaveCtxt
The content of this structure is not made public by the API.
Typedef[xmlSaveCtxt](libxml-xmlsave.html#xmlSaveCtxt)*xmlSaveCtxtPtr
Enum[xmlSaveOption](#xmlSaveOption)
int[xmlSaveClose](#xmlSaveClose)([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt)
long[xmlSaveDoc](#xmlSaveDoc)([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlDocPtr](libxml-tree.html#xmlDocPtr)doc)
int[xmlSaveFlush](#xmlSaveFlush)([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt)
int[xmlSaveSetAttrEscape](#xmlSaveSetAttrEscape)([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlCharEncodingOutputFunc](libxml-encoding.html#xmlCharEncodingOutputFunc)escape)
int[xmlSaveSetEscape](#xmlSaveSetEscape)([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlCharEncodingOutputFunc](libxml-encoding.html#xmlCharEncodingOutputFunc)escape)
[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)[xmlSaveToBuffer](#xmlSaveToBuffer)([xmlBufferPtr](libxml-tree.html#xmlBufferPtr)buffer,
const char * encoding,
int options)
[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)[xmlSaveToFd](#xmlSaveToFd)(int fd,
const char * encoding,
int options)
[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)[xmlSaveToFilename](#xmlSaveToFilename)(const char * filename,
const char * encoding,
int options)
[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)[xmlSaveToIO](#xmlSaveToIO)([xmlOutputWriteCallback](libxml-xmlIO.html#xmlOutputWriteCallback)iowrite,
[xmlOutputCloseCallback](libxml-xmlIO.html#xmlOutputCloseCallback)ioclose,
void * ioctx,
const char * encoding,
int options)
long[xmlSaveTree](#xmlSaveTree)([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlNodePtr](libxml-tree.html#xmlNodePtr)node)

Description

Structure xmlSaveCtxt

Structure xmlSaveCtxt
struct _xmlSaveCtxt {
The content of this structure is not made public by the API.
}

Enum xmlSaveOption

Enum xmlSaveOption {XML\_SAVE\_FORMAT= 1 : format save outputXML\_SAVE\_NO\_DECL= 2 : drop the xml declarationXML\_SAVE\_NO\_EMPTY= 4 : no empty tagsXML\_SAVE\_NO\_XHTML= 8 : disable XHTML1 specific rulesXML\_SAVE\_XHTML= 16 : force XHTML1 specific rulesXML\_SAVE\_AS\_XML= 32 : force XML serialization on HTML docXML\_SAVE\_AS\_HTML= 64 : force HTML serialization on XML docXML\_SAVE\_WSNONSIG= 128 : format with non-significant whitespace
}

Function: xmlSaveClose

int	xmlSaveClose ([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)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. |

Function: xmlSaveDoc

long	xmlSaveDoc ([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlDocPtr](libxml-tree.html#xmlDocPtr)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 |

Function: xmlSaveFlush

int	xmlSaveFlush ([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)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. |

Function: xmlSaveSetAttrEscape

int	xmlSaveSetAttrEscape ([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlCharEncodingOutputFunc](libxml-encoding.html#xmlCharEncodingOutputFunc)escape)

Set a custom escaping function to be used for text in attribute content

| ctxt: | a document saving context | | escape: | the escaping function | | Returns: | 0 if successful or -1 in case of error. |

Function: xmlSaveSetEscape

int	xmlSaveSetEscape ([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlCharEncodingOutputFunc](libxml-encoding.html#xmlCharEncodingOutputFunc)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. |

Function: xmlSaveToBuffer

[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)xmlSaveToBuffer ([xmlBufferPtr](libxml-tree.html#xmlBufferPtr)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. |

Function: xmlSaveToFd

[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)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. |

Function: xmlSaveToFilename

[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)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. |

Function: xmlSaveToIO

[xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)xmlSaveToIO ([xmlOutputWriteCallback](libxml-xmlIO.html#xmlOutputWriteCallback)iowrite,
[xmlOutputCloseCallback](libxml-xmlIO.html#xmlOutputCloseCallback)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. |

Function: xmlSaveTree

long	xmlSaveTree ([xmlSaveCtxtPtr](libxml-xmlsave.html#xmlSaveCtxtPtr)ctxt,
[xmlNodePtr](libxml-tree.html#xmlNodePtr)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: | the top node of the subtree to save | | Returns: | the number of byte written or -1 in case of error |

Daniel Veillard

|

|

|

|

|