# ## Module xmlwriter from libxml2

API Menu
Main Menu Developer Menu Code Examples API Menu Parser API Tree API Reader API XML Guidelines ChangeLog
API Indexes
Alphabetic Constructors Functions/Types Modules Symbols
Related links
Mail archive XSLT libxslt DOM gdome2 XML-DSig xmlsec FTP Windows binaries Solaris binaries MacOsX binaries lxml Python bindings Perl bindings C++ bindings PHP bindings Pascal bindings Ruby bindings Tcl bindings Bug Tracker
text writing API for XML ## Table of Contents
    #define xmlTextWriterWriteDocType
    #define xmlTextWriterWriteProcessingInstruction
    Structure xmlTextWriter
    struct _xmlTextWriter
    The content of this structure is not made public by the API.
    Typedef xmlTextWriter * xmlTextWriterPtr
    void	xmlFreeTextWriter		(xmlTextWriterPtr writer)
    xmlTextWriterPtr	xmlNewTextWriter	(xmlOutputBufferPtr out)
    xmlTextWriterPtr	xmlNewTextWriterDoc	(xmlDocPtr * doc,
    						 int compression)
    xmlTextWriterPtr	xmlNewTextWriterFilename	(const char * uri,
    							 int compression)
    xmlTextWriterPtr	xmlNewTextWriterMemory	(xmlBufferPtr buf,
    						 int compression)
    xmlTextWriterPtr	xmlNewTextWriterPushParser	(xmlParserCtxtPtr ctxt,
    							 int compression)
    xmlTextWriterPtr	xmlNewTextWriterTree	(xmlDocPtr doc,
    						 xmlNodePtr node,
    						 int compression)
    int	xmlTextWriterEndAttribute	(xmlTextWriterPtr writer)
    int	xmlTextWriterEndCDATA		(xmlTextWriterPtr writer)
    int	xmlTextWriterEndComment		(xmlTextWriterPtr writer)
    int	xmlTextWriterEndDTD		(xmlTextWriterPtr writer)
    int	xmlTextWriterEndDTDAttlist	(xmlTextWriterPtr writer)
    int	xmlTextWriterEndDTDElement	(xmlTextWriterPtr writer)
    int	xmlTextWriterEndDTDEntity	(xmlTextWriterPtr writer)
    int	xmlTextWriterEndDocument	(xmlTextWriterPtr writer)
    int	xmlTextWriterEndElement		(xmlTextWriterPtr writer)
    int	xmlTextWriterEndPI		(xmlTextWriterPtr writer)
    int	xmlTextWriterFlush		(xmlTextWriterPtr writer)
    int	xmlTextWriterFullEndElement	(xmlTextWriterPtr writer)
    int	xmlTextWriterSetIndent		(xmlTextWriterPtr writer,
    					 int indent)
    int	xmlTextWriterSetIndentString	(xmlTextWriterPtr writer,
    					 const xmlChar * str)
    int	xmlTextWriterSetQuoteChar	(xmlTextWriterPtr writer,
    					 xmlChar quotechar)
    int	xmlTextWriterStartAttribute	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
    int	xmlTextWriterStartAttributeNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI)
    int	xmlTextWriterStartCDATA		(xmlTextWriterPtr writer)
    int	xmlTextWriterStartComment	(xmlTextWriterPtr writer)
    int	xmlTextWriterStartDTD		(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid)
    int	xmlTextWriterStartDTDAttlist	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
    int	xmlTextWriterStartDTDElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
    int	xmlTextWriterStartDTDEntity	(xmlTextWriterPtr writer,
    					 int pe,
    					 const xmlChar * name)
    int	xmlTextWriterStartDocument	(xmlTextWriterPtr writer,
    					 const char * version,
    					 const char * encoding,
    					 const char * standalone)
    int	xmlTextWriterStartElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
    int	xmlTextWriterStartElementNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI)
    int	xmlTextWriterStartPI		(xmlTextWriterPtr writer,
    					 const xmlChar * target)
    int	xmlTextWriterWriteAttribute	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
    int	xmlTextWriterWriteAttributeNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI,
    					 const xmlChar * content)
    int	xmlTextWriterWriteBase64	(xmlTextWriterPtr writer,
    					 const char * data,
    					 int start,
    					 int len)
    int	xmlTextWriterWriteBinHex	(xmlTextWriterPtr writer,
    					 const char * data,
    					 int start,
    					 int len)
    int	xmlTextWriterWriteCDATA		(xmlTextWriterPtr writer,
    					 const xmlChar * content)
    int	xmlTextWriterWriteComment	(xmlTextWriterPtr writer,
    					 const xmlChar * content)
    int	xmlTextWriterWriteDTD		(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const xmlChar * subset)
    int	xmlTextWriterWriteDTDAttlist	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
    int	xmlTextWriterWriteDTDElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
    int	xmlTextWriterWriteDTDEntity	(xmlTextWriterPtr writer,
    					 int pe,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const xmlChar * ndataid,
    					 const xmlChar * content)
    int	xmlTextWriterWriteDTDExternalEntity	(xmlTextWriterPtr writer,
    						 int pe,
    						 const xmlChar * name,
    						 const xmlChar * pubid,
    						 const xmlChar * sysid,
    						 const xmlChar * ndataid)
    int	xmlTextWriterWriteDTDExternalEntityContents	(xmlTextWriterPtr writer,
    							 const xmlChar * pubid,
    							 const xmlChar * sysid,
    							 const xmlChar * ndataid)
    int	xmlTextWriterWriteDTDInternalEntity	(xmlTextWriterPtr writer,
    						 int pe,
    						 const xmlChar * name,
    						 const xmlChar * content)
    int	xmlTextWriterWriteDTDNotation	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid)
    int	xmlTextWriterWriteElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
    int	xmlTextWriterWriteElementNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI,
    					 const xmlChar * content)
    int	xmlTextWriterWriteFormatAttribute	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 ... ...)
    int	xmlTextWriterWriteFormatAttributeNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 ... ...)
    int	xmlTextWriterWriteFormatCDATA	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWriteFormatComment	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWriteFormatDTD	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWriteFormatDTDAttlist	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 ... ...)
    int	xmlTextWriterWriteFormatDTDElement	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 ... ...)
    int	xmlTextWriterWriteFormatDTDInternalEntity	(xmlTextWriterPtr writer,
    							 int pe,
    							 const xmlChar * name,
    							 const char * format,
    							 ... ...)
    int	xmlTextWriterWriteFormatElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWriteFormatElementNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 ... ...)
    int	xmlTextWriterWriteFormatPI	(xmlTextWriterPtr writer,
    					 const xmlChar * target,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWriteFormatRaw	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWriteFormatString	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
    int	xmlTextWriterWritePI		(xmlTextWriterPtr writer,
    					 const xmlChar * target,
    					 const xmlChar * content)
    int	xmlTextWriterWriteRaw		(xmlTextWriterPtr writer,
    					 const xmlChar * content)
    int	xmlTextWriterWriteRawLen	(xmlTextWriterPtr writer,
    					 const xmlChar * content,
    					 int len)
    int	xmlTextWriterWriteString	(xmlTextWriterPtr writer,
    					 const xmlChar * content)
    int	xmlTextWriterWriteVFormatAttribute	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatAttributeNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatCDATA	(xmlTextWriterPtr writer,
    					 const char * format,
    					 va_list argptr)
    int	xmlTextWriterWriteVFormatComment	(xmlTextWriterPtr writer,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatDTD	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const char * format,
    					 va_list argptr)
    int	xmlTextWriterWriteVFormatDTDAttlist	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatDTDElement	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatDTDInternalEntity	(xmlTextWriterPtr writer,
    							 int pe,
    							 const xmlChar * name,
    							 const char * format,
    							 va_list argptr)
    int	xmlTextWriterWriteVFormatElement	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatElementNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 va_list argptr)
    int	xmlTextWriterWriteVFormatPI	(xmlTextWriterPtr writer,
    					 const xmlChar * target,
    					 const char * format,
    					 va_list argptr)
    int	xmlTextWriterWriteVFormatRaw	(xmlTextWriterPtr writer,
    					 const char * format,
    					 va_list argptr)
    int	xmlTextWriterWriteVFormatString	(xmlTextWriterPtr writer,
    					 const char * format,
    					 va_list argptr)
## Description ### Macro: xmlTextWriterWriteDocType
    #define xmlTextWriterWriteDocType
this macro maps to xmlTextWriterWriteDTD ### Macro: xmlTextWriterWriteProcessingInstruction
    #define xmlTextWriterWriteProcessingInstruction
This macro maps to xmlTextWriterWritePI ### Structure xmlTextWriter
    Structure xmlTextWriter
    struct _xmlTextWriter {
    The content of this structure is not made public by the API.
    }
### Function: xmlFreeTextWriter
    void	xmlFreeTextWriter		(xmlTextWriterPtr writer)
Deallocate all the resources associated to the writer
`writer`: | the xmlTextWriterPtr
### Function: xmlNewTextWriter
    xmlTextWriterPtr	xmlNewTextWriter	(xmlOutputBufferPtr out)
Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr NOTE: the @out parameter will be deallocated when the writer is closed (if the call succeed.)
`out`: | an xmlOutputBufferPtr
`Returns`: | the new xmlTextWriterPtr or NULL in case of error
### Function: xmlNewTextWriterDoc
    xmlTextWriterPtr	xmlNewTextWriterDoc	(xmlDocPtr * doc,
    						 int compression)
Create a new xmlNewTextWriter structure with @*doc as output
`doc`: | address of a xmlDocPtr to hold the new XML document tree
`compression`: | compress the output?
`Returns`: | the new xmlTextWriterPtr or NULL in case of error
### Function: xmlNewTextWriterFilename
    xmlTextWriterPtr	xmlNewTextWriterFilename	(const char * uri,
    							 int compression)
Create a new xmlNewTextWriter structure with @uri as output
`uri`: | the URI of the resource for the output
`compression`: | compress the output?
`Returns`: | the new xmlTextWriterPtr or NULL in case of error
### Function: xmlNewTextWriterMemory
    xmlTextWriterPtr	xmlNewTextWriterMemory	(xmlBufferPtr buf,
    						 int compression)
Create a new xmlNewTextWriter structure with @buf as output TODO: handle compression
`buf`: | xmlBufferPtr
`compression`: | compress the output?
`Returns`: | the new xmlTextWriterPtr or NULL in case of error
### Function: xmlNewTextWriterPushParser
    xmlTextWriterPtr	xmlNewTextWriterPushParser	(xmlParserCtxtPtr ctxt,
    							 int compression)
Create a new xmlNewTextWriter structure with @ctxt as output NOTE: the @ctxt context will be freed with the resulting writer (if the call succeeds). TODO: handle compression
`ctxt`: | xmlParserCtxtPtr to hold the new XML document tree
`compression`: | compress the output?
`Returns`: | the new xmlTextWriterPtr or NULL in case of error
### Function: xmlNewTextWriterTree
    xmlTextWriterPtr	xmlNewTextWriterTree	(xmlDocPtr doc,
    						 xmlNodePtr node,
    						 int compression)
Create a new xmlNewTextWriter structure with @doc as output starting at @node
`doc`: | xmlDocPtr
`node`: | xmlNodePtr or NULL for doc->children
`compression`: | compress the output?
`Returns`: | the new xmlTextWriterPtr or NULL in case of error
### Function: xmlTextWriterEndAttribute
    int	xmlTextWriterEndAttribute	(xmlTextWriterPtr writer)
End the current xml element.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndCDATA
    int	xmlTextWriterEndCDATA		(xmlTextWriterPtr writer)
End an xml CDATA section.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndComment
    int	xmlTextWriterEndComment		(xmlTextWriterPtr writer)
End the current xml comment.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndDTD
    int	xmlTextWriterEndDTD		(xmlTextWriterPtr writer)
End an xml DTD.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndDTDAttlist
    int	xmlTextWriterEndDTDAttlist	(xmlTextWriterPtr writer)
End an xml DTD attribute list.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndDTDElement
    int	xmlTextWriterEndDTDElement	(xmlTextWriterPtr writer)
End an xml DTD element.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndDTDEntity
    int	xmlTextWriterEndDTDEntity	(xmlTextWriterPtr writer)
End an xml DTD entity.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndDocument
    int	xmlTextWriterEndDocument	(xmlTextWriterPtr writer)
End an xml document. All open elements are closed, and the content is flushed to the output.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written or -1 in case of error
### Function: xmlTextWriterEndElement
    int	xmlTextWriterEndElement		(xmlTextWriterPtr writer)
End the current xml element.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterEndPI
    int	xmlTextWriterEndPI		(xmlTextWriterPtr writer)
End the current xml PI.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterFlush
    int	xmlTextWriterFlush		(xmlTextWriterPtr writer)
Flush the output buffer.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterFullEndElement
    int	xmlTextWriterFullEndElement	(xmlTextWriterPtr writer)
End the current xml element. Writes an end tag even if the element is empty
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterSetIndent
    int	xmlTextWriterSetIndent		(xmlTextWriterPtr writer,
    					 int indent)
Set indentation output. indent = 0 do not indentation. indent > 0 do indentation.
`writer`: | the xmlTextWriterPtr
`indent`: | do indentation?
`Returns`: | -1 on error or 0 otherwise.
### Function: xmlTextWriterSetIndentString
    int	xmlTextWriterSetIndentString	(xmlTextWriterPtr writer,
    					 const xmlChar * str)
Set string indentation.
`writer`: | the xmlTextWriterPtr
`str`: | the xmlChar string
`Returns`: | -1 on error or 0 otherwise.
### Function: xmlTextWriterSetQuoteChar
    int	xmlTextWriterSetQuoteChar	(xmlTextWriterPtr writer,
    					 xmlChar quotechar)
Set the character used for quoting attributes.
`writer`: | the xmlTextWriterPtr
`quotechar`: | the quote character
`Returns`: | -1 on error or 0 otherwise.
### Function: xmlTextWriterStartAttribute
    int	xmlTextWriterStartAttribute	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
Start an xml attribute.
`writer`: | the xmlTextWriterPtr
`name`: | element name
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartAttributeNS
    int	xmlTextWriterStartAttributeNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI)
Start an xml attribute with namespace support.
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix or NULL
`name`: | element local name
`namespaceURI`: | namespace URI or NULL
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartCDATA
    int	xmlTextWriterStartCDATA		(xmlTextWriterPtr writer)
Start an xml CDATA section.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartComment
    int	xmlTextWriterStartComment	(xmlTextWriterPtr writer)
Start an xml comment.
`writer`: | the xmlTextWriterPtr
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartDTD
    int	xmlTextWriterStartDTD		(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid)
Start an xml DTD.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartDTDAttlist
    int	xmlTextWriterStartDTDAttlist	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
Start an xml DTD ATTLIST.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD ATTLIST
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartDTDElement
    int	xmlTextWriterStartDTDElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
Start an xml DTD element.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD element
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartDTDEntity
    int	xmlTextWriterStartDTDEntity	(xmlTextWriterPtr writer,
    					 int pe,
    					 const xmlChar * name)
Start an xml DTD ATTLIST.
`writer`: | the xmlTextWriterPtr
`pe`: | TRUE if this is a parameter entity, FALSE if not
`name`: | the name of the DTD ATTLIST
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartDocument
    int	xmlTextWriterStartDocument	(xmlTextWriterPtr writer,
    					 const char * version,
    					 const char * encoding,
    					 const char * standalone)
Start a new xml document
`writer`: | the xmlTextWriterPtr
`version`: | the xml version ("1.0") or NULL for default ("1.0")
`encoding`: | the encoding or NULL for default
`standalone`: | "yes" or "no" or NULL for default
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartElement
    int	xmlTextWriterStartElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name)
Start an xml element.
`writer`: | the xmlTextWriterPtr
`name`: | element name
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartElementNS
    int	xmlTextWriterStartElementNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI)
Start an xml element with namespace support.
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix or NULL
`name`: | element local name
`namespaceURI`: | namespace URI or NULL
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterStartPI
    int	xmlTextWriterStartPI		(xmlTextWriterPtr writer,
    					 const xmlChar * target)
Start an xml PI.
`writer`: | the xmlTextWriterPtr
`target`: | PI target
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteAttribute
    int	xmlTextWriterWriteAttribute	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
Write an xml attribute.
`writer`: | the xmlTextWriterPtr
`name`: | attribute name
`content`: | attribute content
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteAttributeNS
    int	xmlTextWriterWriteAttributeNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI,
    					 const xmlChar * content)
Write an xml attribute.
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix
`name`: | attribute local name
`namespaceURI`: | namespace URI
`content`: | attribute content
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteBase64
    int	xmlTextWriterWriteBase64	(xmlTextWriterPtr writer,
    					 const char * data,
    					 int start,
    					 int len)
Write an base64 encoded xml text.
`writer`: | the xmlTextWriterPtr
`data`: | binary data
`start`: | the position within the data of the first byte to encode
`len`: | the number of bytes to encode
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteBinHex
    int	xmlTextWriterWriteBinHex	(xmlTextWriterPtr writer,
    					 const char * data,
    					 int start,
    					 int len)
Write a BinHex encoded xml text.
`writer`: | the xmlTextWriterPtr
`data`: | binary data
`start`: | the position within the data of the first byte to encode
`len`: | the number of bytes to encode
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteCDATA
    int	xmlTextWriterWriteCDATA		(xmlTextWriterPtr writer,
    					 const xmlChar * content)
Write an xml CDATA.
`writer`: | the xmlTextWriterPtr
`content`: | CDATA content
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteComment
    int	xmlTextWriterWriteComment	(xmlTextWriterPtr writer,
    					 const xmlChar * content)
Write an xml comment.
`writer`: | the xmlTextWriterPtr
`content`: | comment string
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTD
    int	xmlTextWriterWriteDTD		(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const xmlChar * subset)
Write a DTD.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`subset`: | string content of the DTD
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDAttlist
    int	xmlTextWriterWriteDTDAttlist	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
Write a DTD ATTLIST.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD ATTLIST
`content`: | content of the ATTLIST
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDElement
    int	xmlTextWriterWriteDTDElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
Write a DTD element.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD element
`content`: | content of the element
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDEntity
    int	xmlTextWriterWriteDTDEntity	(xmlTextWriterPtr writer,
    					 int pe,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const xmlChar * ndataid,
    					 const xmlChar * content)
Write a DTD entity.
`writer`: | the xmlTextWriterPtr
`pe`: | TRUE if this is a parameter entity, FALSE if not
`name`: | the name of the DTD entity
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`ndataid`: | the xml notation name.
`content`: | content of the entity
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDExternalEntity
    int	xmlTextWriterWriteDTDExternalEntity	(xmlTextWriterPtr writer,
    						 int pe,
    						 const xmlChar * name,
    						 const xmlChar * pubid,
    						 const xmlChar * sysid,
    						 const xmlChar * ndataid)
Write a DTD external entity. The entity must have been started with xmlTextWriterStartDTDEntity
`writer`: | the xmlTextWriterPtr
`pe`: | TRUE if this is a parameter entity, FALSE if not
`name`: | the name of the DTD entity
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`ndataid`: | the xml notation name.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDExternalEntityContents
    int	xmlTextWriterWriteDTDExternalEntityContents	(xmlTextWriterPtr writer,
    							 const xmlChar * pubid,
    							 const xmlChar * sysid,
    							 const xmlChar * ndataid)
Write the contents of a DTD external entity.
`writer`: | the xmlTextWriterPtr
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`ndataid`: | the xml notation name.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDInternalEntity
    int	xmlTextWriterWriteDTDInternalEntity	(xmlTextWriterPtr writer,
    						 int pe,
    						 const xmlChar * name,
    						 const xmlChar * content)
Write a DTD internal entity.
`writer`: | the xmlTextWriterPtr
`pe`: | TRUE if this is a parameter entity, FALSE if not
`name`: | the name of the DTD entity
`content`: | content of the entity
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteDTDNotation
    int	xmlTextWriterWriteDTDNotation	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid)
Write a DTD entity.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the xml notation
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteElement
    int	xmlTextWriterWriteElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * content)
Write an xml element.
`writer`: | the xmlTextWriterPtr
`name`: | element name
`content`: | element content
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteElementNS
    int	xmlTextWriterWriteElementNS	(xmlTextWriterPtr writer,
    					 const xmlChar * prefix,
    					 const xmlChar * name,
    					 const xmlChar * namespaceURI,
    					 const xmlChar * content)
Write an xml element with namespace support.
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix
`name`: | element local name
`namespaceURI`: | namespace URI
`content`: | element content
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatAttribute
    int	xmlTextWriterWriteFormatAttribute	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 ... ...)
Write a formatted xml attribute.
`writer`: | the xmlTextWriterPtr
`name`: | attribute name
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatAttributeNS
    int	xmlTextWriterWriteFormatAttributeNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 ... ...)
Write a formatted xml attribute.with namespace support
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix
`name`: | attribute local name
`namespaceURI`: | namespace URI
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatCDATA
    int	xmlTextWriterWriteFormatCDATA	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
Write a formatted xml CDATA.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatComment
    int	xmlTextWriterWriteFormatComment	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
Write an xml comment.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatDTD
    int	xmlTextWriterWriteFormatDTD	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const char * format,
    					 ... ...)
Write a DTD with a formatted markup declarations part.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatDTDAttlist
    int	xmlTextWriterWriteFormatDTDAttlist	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 ... ...)
Write a formatted DTD ATTLIST.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD ATTLIST
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatDTDElement
    int	xmlTextWriterWriteFormatDTDElement	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 ... ...)
Write a formatted DTD element.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD element
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatDTDInternalEntity
    int	xmlTextWriterWriteFormatDTDInternalEntity	(xmlTextWriterPtr writer,
    							 int pe,
    							 const xmlChar * name,
    							 const char * format,
    							 ... ...)
Write a formatted DTD internal entity.
`writer`: | the xmlTextWriterPtr
`pe`: | TRUE if this is a parameter entity, FALSE if not
`name`: | the name of the DTD entity
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatElement
    int	xmlTextWriterWriteFormatElement	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const char * format,
    					 ... ...)
Write a formatted xml element.
`writer`: | the xmlTextWriterPtr
`name`: | element name
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatElementNS
    int	xmlTextWriterWriteFormatElementNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 ... ...)
Write a formatted xml element with namespace support.
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix
`name`: | element local name
`namespaceURI`: | namespace URI
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatPI
    int	xmlTextWriterWriteFormatPI	(xmlTextWriterPtr writer,
    					 const xmlChar * target,
    					 const char * format,
    					 ... ...)
Write a formatted PI.
`writer`: | the xmlTextWriterPtr
`target`: | PI target
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatRaw
    int	xmlTextWriterWriteFormatRaw	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
Write a formatted raw xml text.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteFormatString
    int	xmlTextWriterWriteFormatString	(xmlTextWriterPtr writer,
    					 const char * format,
    					 ... ...)
Write a formatted xml text.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`...`: | extra parameters for the format
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWritePI
    int	xmlTextWriterWritePI		(xmlTextWriterPtr writer,
    					 const xmlChar * target,
    					 const xmlChar * content)
Write an xml PI.
`writer`: | the xmlTextWriterPtr
`target`: | PI target
`content`: | PI content
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteRaw
    int	xmlTextWriterWriteRaw		(xmlTextWriterPtr writer,
    					 const xmlChar * content)
Write a raw xml text.
`writer`: | the xmlTextWriterPtr
`content`: | text string
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteRawLen
    int	xmlTextWriterWriteRawLen	(xmlTextWriterPtr writer,
    					 const xmlChar * content,
    					 int len)
Write an xml text. TODO: what about entities and special chars??
`writer`: | the xmlTextWriterPtr
`content`: | text string
`len`: | length of the text string
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteString
    int	xmlTextWriterWriteString	(xmlTextWriterPtr writer,
    					 const xmlChar * content)
Write an xml text.
`writer`: | the xmlTextWriterPtr
`content`: | text string
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatAttribute
    int	xmlTextWriterWriteVFormatAttribute	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
Write a formatted xml attribute.
`writer`: | the xmlTextWriterPtr
`name`: | attribute name
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatAttributeNS
    int	xmlTextWriterWriteVFormatAttributeNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 va_list argptr)
Write a formatted xml attribute.with namespace support
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix
`name`: | attribute local name
`namespaceURI`: | namespace URI
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatCDATA
    int	xmlTextWriterWriteVFormatCDATA	(xmlTextWriterPtr writer,
    					 const char * format,
    					 va_list argptr)
Write a formatted xml CDATA.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatComment
    int	xmlTextWriterWriteVFormatComment	(xmlTextWriterPtr writer,
    						 const char * format,
    						 va_list argptr)
Write an xml comment.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatDTD
    int	xmlTextWriterWriteVFormatDTD	(xmlTextWriterPtr writer,
    					 const xmlChar * name,
    					 const xmlChar * pubid,
    					 const xmlChar * sysid,
    					 const char * format,
    					 va_list argptr)
Write a DTD with a formatted markup declarations part.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD
`pubid`: | the public identifier, which is an alternative to the system identifier
`sysid`: | the system identifier, which is the URI of the DTD
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatDTDAttlist
    int	xmlTextWriterWriteVFormatDTDAttlist	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
Write a formatted DTD ATTLIST.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD ATTLIST
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatDTDElement
    int	xmlTextWriterWriteVFormatDTDElement	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
Write a formatted DTD element.
`writer`: | the xmlTextWriterPtr
`name`: | the name of the DTD element
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatDTDInternalEntity
    int	xmlTextWriterWriteVFormatDTDInternalEntity	(xmlTextWriterPtr writer,
    							 int pe,
    							 const xmlChar * name,
    							 const char * format,
    							 va_list argptr)
Write a formatted DTD internal entity.
`writer`: | the xmlTextWriterPtr
`pe`: | TRUE if this is a parameter entity, FALSE if not
`name`: | the name of the DTD entity
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatElement
    int	xmlTextWriterWriteVFormatElement	(xmlTextWriterPtr writer,
    						 const xmlChar * name,
    						 const char * format,
    						 va_list argptr)
Write a formatted xml element.
`writer`: | the xmlTextWriterPtr
`name`: | element name
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatElementNS
    int	xmlTextWriterWriteVFormatElementNS	(xmlTextWriterPtr writer,
    						 const xmlChar * prefix,
    						 const xmlChar * name,
    						 const xmlChar * namespaceURI,
    						 const char * format,
    						 va_list argptr)
Write a formatted xml element with namespace support.
`writer`: | the xmlTextWriterPtr
`prefix`: | namespace prefix
`name`: | element local name
`namespaceURI`: | namespace URI
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatPI
    int	xmlTextWriterWriteVFormatPI	(xmlTextWriterPtr writer,
    					 const xmlChar * target,
    					 const char * format,
    					 va_list argptr)
Write a formatted xml PI.
`writer`: | the xmlTextWriterPtr
`target`: | PI target
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatRaw
    int	xmlTextWriterWriteVFormatRaw	(xmlTextWriterPtr writer,
    					 const char * format,
    					 va_list argptr)
Write a formatted raw xml text.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
### Function: xmlTextWriterWriteVFormatString
    int	xmlTextWriterWriteVFormatString	(xmlTextWriterPtr writer,
    					 const char * format,
    					 va_list argptr)
Write a formatted xml text.
`writer`: | the xmlTextWriterPtr
`format`: | format string (see printf)
`argptr`: | pointer to the first member of the variable argument list.
`Returns`: | the bytes written (may be 0 because of buffering) or -1 in case of error
Daniel Veillard