libxml2
Loading...
Searching...
No Matches
xmlwriter.h File Reference

text writing API for XML More...

Macros

#define xmlTextWriterWriteProcessingInstruction   xmlTextWriterWritePI
 This macro maps to xmlTextWriterWritePI.
#define xmlTextWriterWriteDocType   xmlTextWriterWriteDTD
 this macro maps to xmlTextWriterWriteDTD

Typedefs

typedef struct _xmlTextWriter xmlTextWriter
 Writer object.

Functions

xmlTextWriterxmlNewTextWriter (xmlOutputBuffer *out)
 Create a new xmlTextWriter structure using an xmlOutputBuffer NOTE: the out parameter will be deallocated when the writer is closed (if the call succeed.)
xmlTextWriterxmlNewTextWriterFilename (const char *uri, int compression)
 Create a new xmlTextWriter structure with uri as output.
xmlTextWriterxmlNewTextWriterMemory (xmlBuffer *buf, int compression)
 Create a new xmlTextWriter structure with buf as output TODO: handle compression.
xmlTextWriterxmlNewTextWriterPushParser (xmlParserCtxt *ctxt, int compression)
 Create a new xmlTextWriter structure with ctxt as output NOTE: the ctxt context will be freed with the resulting writer (if the call succeeds).
xmlTextWriterxmlNewTextWriterDoc (xmlDoc **doc, int compression)
 Create a new xmlTextWriter structure with doc as output.
xmlTextWriterxmlNewTextWriterTree (xmlDoc *doc, xmlNode *node, int compression)
 Create a new xmlTextWriter structure with doc as output starting at node
void xmlFreeTextWriter (xmlTextWriter *writer)
 Deallocate all the resources associated to the writer.
int xmlTextWriterStartDocument (xmlTextWriter *writer, const char *version, const char *encoding, const char *standalone)
 Start a new xml document.
int xmlTextWriterEndDocument (xmlTextWriter *writer)
 End an xml document.
int xmlTextWriterStartComment (xmlTextWriter *writer)
 Start an xml comment.
int xmlTextWriterEndComment (xmlTextWriter *writer)
 End the current xml comment.
int xmlTextWriterWriteFormatComment (xmlTextWriter *writer, const char *format,...)
 Write an xml comment.
int xmlTextWriterWriteVFormatComment (xmlTextWriter *writer, const char *format, va_list argptr)
 Write an xml comment.
int xmlTextWriterWriteComment (xmlTextWriter *writer, const xmlChar *content)
 Write an xml comment.
int xmlTextWriterStartElement (xmlTextWriter *writer, const xmlChar *name)
 Start an xml element.
int xmlTextWriterStartElementNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI)
 Start an xml element with namespace support.
int xmlTextWriterEndElement (xmlTextWriter *writer)
 End the current xml element.
int xmlTextWriterFullEndElement (xmlTextWriter *writer)
 End the current xml element.
int xmlTextWriterWriteFormatElement (xmlTextWriter *writer, const xmlChar *name, const char *format,...)
 Write a formatted xml element.
int xmlTextWriterWriteVFormatElement (xmlTextWriter *writer, const xmlChar *name, const char *format, va_list argptr)
 Write a formatted xml element.
int xmlTextWriterWriteElement (xmlTextWriter *writer, const xmlChar *name, const xmlChar *content)
 Write an xml element.
int xmlTextWriterWriteFormatElementNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const char *format,...)
 Write a formatted xml element with namespace support.
int xmlTextWriterWriteVFormatElementNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const char *format, va_list argptr)
 Write a formatted xml element with namespace support.
int xmlTextWriterWriteElementNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const xmlChar *content)
 Write an xml element with namespace support.
int xmlTextWriterWriteFormatRaw (xmlTextWriter *writer, const char *format,...)
 Write a formatted raw xml text.
int xmlTextWriterWriteVFormatRaw (xmlTextWriter *writer, const char *format, va_list argptr)
 Write a formatted raw xml text.
int xmlTextWriterWriteRawLen (xmlTextWriter *writer, const xmlChar *content, int len)
 Write an xml text.
int xmlTextWriterWriteRaw (xmlTextWriter *writer, const xmlChar *content)
 Write a raw xml text.
int xmlTextWriterWriteFormatString (xmlTextWriter *writer, const char *format,...)
 Write a formatted xml text.
int xmlTextWriterWriteVFormatString (xmlTextWriter *writer, const char *format, va_list argptr)
 Write a formatted xml text.
int xmlTextWriterWriteString (xmlTextWriter *writer, const xmlChar *content)
 Write an xml text.
int xmlTextWriterWriteBase64 (xmlTextWriter *writer, const char *data, int start, int len)
 Write an base64 encoded xml text.
int xmlTextWriterWriteBinHex (xmlTextWriter *writer, const char *data, int start, int len)
 Write a BinHex encoded xml text.
int xmlTextWriterStartAttribute (xmlTextWriter *writer, const xmlChar *name)
 Start an xml attribute.
int xmlTextWriterStartAttributeNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI)
 Start an xml attribute with namespace support.
int xmlTextWriterEndAttribute (xmlTextWriter *writer)
 End the current xml element.
int xmlTextWriterWriteFormatAttribute (xmlTextWriter *writer, const xmlChar *name, const char *format,...)
 Write a formatted xml attribute.
int xmlTextWriterWriteVFormatAttribute (xmlTextWriter *writer, const xmlChar *name, const char *format, va_list argptr)
 Write a formatted xml attribute.
int xmlTextWriterWriteAttribute (xmlTextWriter *writer, const xmlChar *name, const xmlChar *content)
 Write an xml attribute.
int xmlTextWriterWriteFormatAttributeNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const char *format,...)
 Write a formatted xml attribute.with namespace support.
int xmlTextWriterWriteVFormatAttributeNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const char *format, va_list argptr)
 Write a formatted xml attribute.with namespace support.
int xmlTextWriterWriteAttributeNS (xmlTextWriter *writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const xmlChar *content)
 Write an xml attribute.
int xmlTextWriterStartPI (xmlTextWriter *writer, const xmlChar *target)
 Start an xml PI.
int xmlTextWriterEndPI (xmlTextWriter *writer)
 End the current xml PI.
int xmlTextWriterWriteFormatPI (xmlTextWriter *writer, const xmlChar *target, const char *format,...)
 Write a formatted PI.
int xmlTextWriterWriteVFormatPI (xmlTextWriter *writer, const xmlChar *target, const char *format, va_list argptr)
 Write a formatted xml PI.
int xmlTextWriterWritePI (xmlTextWriter *writer, const xmlChar *target, const xmlChar *content)
 Write an xml PI.
int xmlTextWriterStartCDATA (xmlTextWriter *writer)
 Start an xml CDATA section.
int xmlTextWriterEndCDATA (xmlTextWriter *writer)
 End an xml CDATA section.
int xmlTextWriterWriteFormatCDATA (xmlTextWriter *writer, const char *format,...)
 Write a formatted xml CDATA.
int xmlTextWriterWriteVFormatCDATA (xmlTextWriter *writer, const char *format, va_list argptr)
 Write a formatted xml CDATA.
int xmlTextWriterWriteCDATA (xmlTextWriter *writer, const xmlChar *content)
 Write an xml CDATA.
int xmlTextWriterStartDTD (xmlTextWriter *writer, const xmlChar *name, const xmlChar *pubid, const xmlChar *sysid)
 Start an xml DTD.
int xmlTextWriterEndDTD (xmlTextWriter *writer)
 End an xml DTD.
int xmlTextWriterWriteFormatDTD (xmlTextWriter *writer, const xmlChar *name, const xmlChar *pubid, const xmlChar *sysid, const char *format,...)
 Write a DTD with a formatted markup declarations part.
int xmlTextWriterWriteVFormatDTD (xmlTextWriter *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.
int xmlTextWriterWriteDTD (xmlTextWriter *writer, const xmlChar *name, const xmlChar *pubid, const xmlChar *sysid, const xmlChar *subset)
 Write a DTD.
int xmlTextWriterStartDTDElement (xmlTextWriter *writer, const xmlChar *name)
 Start an xml DTD element.
int xmlTextWriterEndDTDElement (xmlTextWriter *writer)
 End an xml DTD element.
int xmlTextWriterWriteFormatDTDElement (xmlTextWriter *writer, const xmlChar *name, const char *format,...)
 Write a formatted DTD element.
int xmlTextWriterWriteVFormatDTDElement (xmlTextWriter *writer, const xmlChar *name, const char *format, va_list argptr)
 Write a formatted DTD element.
int xmlTextWriterWriteDTDElement (xmlTextWriter *writer, const xmlChar *name, const xmlChar *content)
 Write a DTD element.
int xmlTextWriterStartDTDAttlist (xmlTextWriter *writer, const xmlChar *name)
 Start an xml DTD ATTLIST.
int xmlTextWriterEndDTDAttlist (xmlTextWriter *writer)
 End an xml DTD attribute list.
int xmlTextWriterWriteFormatDTDAttlist (xmlTextWriter *writer, const xmlChar *name, const char *format,...)
 Write a formatted DTD ATTLIST.
int xmlTextWriterWriteVFormatDTDAttlist (xmlTextWriter *writer, const xmlChar *name, const char *format, va_list argptr)
 Write a formatted DTD ATTLIST.
int xmlTextWriterWriteDTDAttlist (xmlTextWriter *writer, const xmlChar *name, const xmlChar *content)
 Write a DTD ATTLIST.
int xmlTextWriterStartDTDEntity (xmlTextWriter *writer, int pe, const xmlChar *name)
 Start an xml DTD ATTLIST.
int xmlTextWriterEndDTDEntity (xmlTextWriter *writer)
 End an xml DTD entity.
int xmlTextWriterWriteFormatDTDInternalEntity (xmlTextWriter *writer, int pe, const xmlChar *name, const char *format,...)
 Write a formatted DTD internal entity.
int xmlTextWriterWriteVFormatDTDInternalEntity (xmlTextWriter *writer, int pe, const xmlChar *name, const char *format, va_list argptr)
 Write a formatted DTD internal entity.
int xmlTextWriterWriteDTDInternalEntity (xmlTextWriter *writer, int pe, const xmlChar *name, const xmlChar *content)
 Write a DTD internal entity.
int xmlTextWriterWriteDTDExternalEntity (xmlTextWriter *writer, int pe, const xmlChar *name, const xmlChar *pubid, const xmlChar *sysid, const xmlChar *ndataid)
 Write a DTD external entity.
int xmlTextWriterWriteDTDExternalEntityContents (xmlTextWriter *writer, const xmlChar *pubid, const xmlChar *sysid, const xmlChar *ndataid)
 Write the contents of a DTD external entity.
int xmlTextWriterWriteDTDEntity (xmlTextWriter *writer, int pe, const xmlChar *name, const xmlChar *pubid, const xmlChar *sysid, const xmlChar *ndataid, const xmlChar *content)
 Write a DTD entity.
int xmlTextWriterWriteDTDNotation (xmlTextWriter *writer, const xmlChar *name, const xmlChar *pubid, const xmlChar *sysid)
 Write a DTD entity.
int xmlTextWriterSetIndent (xmlTextWriter *writer, int indent)
 Set indentation output.
int xmlTextWriterSetIndentString (xmlTextWriter *writer, const xmlChar *str)
 Set string indentation.
int xmlTextWriterSetQuoteChar (xmlTextWriter *writer, xmlChar quotechar)
 Set the character used for quoting attributes.
int xmlTextWriterFlush (xmlTextWriter *writer)
 Flush the output buffer.
int xmlTextWriterClose (xmlTextWriter *writer)
 Flushes and closes the output buffer.

Detailed Description

text writing API for XML

text writing API for XML

Author
Alfred Mickautsch

Function Documentation

◆ xmlFreeTextWriter()

void xmlFreeTextWriter ( xmlTextWriter * writer)

Deallocate all the resources associated to the writer.

Parameters
writerthe xmlTextWriter

◆ xmlNewTextWriter()

xmlTextWriter * xmlNewTextWriter ( xmlOutputBuffer * out)

Create a new xmlTextWriter structure using an xmlOutputBuffer NOTE: the out parameter will be deallocated when the writer is closed (if the call succeed.)

Parameters
outan xmlOutputBuffer
Returns
the new xmlTextWriter or NULL in case of error

◆ xmlNewTextWriterDoc()

xmlTextWriter * xmlNewTextWriterDoc ( xmlDoc ** doc,
int compression )

Create a new xmlTextWriter structure with doc as output.

Parameters
docaddress of a xmlDoc to hold the new XML document tree
compressioncompress the output?
Returns
the new xmlTextWriter or NULL in case of error

◆ xmlNewTextWriterFilename()

xmlTextWriter * xmlNewTextWriterFilename ( const char * uri,
int compression )

Create a new xmlTextWriter structure with uri as output.

Parameters
urithe URI of the resource for the output
compressioncompress the output?
Returns
the new xmlTextWriter or NULL in case of error

◆ xmlNewTextWriterMemory()

xmlTextWriter * xmlNewTextWriterMemory ( xmlBuffer * buf,
int compression )

Create a new xmlTextWriter structure with buf as output TODO: handle compression.

Parameters
bufxmlBuffer
compressioncompress the output?
Returns
the new xmlTextWriter or NULL in case of error

◆ xmlNewTextWriterPushParser()

xmlTextWriter * xmlNewTextWriterPushParser ( xmlParserCtxt * ctxt,
int compression )

Create a new xmlTextWriter structure with ctxt as output NOTE: the ctxt context will be freed with the resulting writer (if the call succeeds).

TODO: handle compression

Parameters
ctxtxmlParserCtxt to hold the new XML document tree
compressioncompress the output?
Returns
the new xmlTextWriter or NULL in case of error

◆ xmlNewTextWriterTree()

xmlTextWriter * xmlNewTextWriterTree ( xmlDoc * doc,
xmlNode * node,
int compression )

Create a new xmlTextWriter structure with doc as output starting at node

Parameters
docxmlDoc
nodexmlNode or NULL for doc->children
compressioncompress the output?
Returns
the new xmlTextWriter or NULL in case of error

◆ xmlTextWriterClose()

int xmlTextWriterClose ( xmlTextWriter * writer)

Flushes and closes the output buffer.

Since
2.13.0
Parameters
writerthe xmlTextWriter
Returns
an xmlParserErrors code.

◆ xmlTextWriterEndAttribute()

int xmlTextWriterEndAttribute ( xmlTextWriter * writer)

End the current xml element.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndCDATA()

int xmlTextWriterEndCDATA ( xmlTextWriter * writer)

End an xml CDATA section.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndComment()

int xmlTextWriterEndComment ( xmlTextWriter * writer)

End the current xml comment.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndDocument()

int xmlTextWriterEndDocument ( xmlTextWriter * writer)

End an xml document.

All open elements are closed, and the content is flushed to the output.

Parameters
writerthe xmlTextWriter
Returns
the bytes written or -1 in case of error

◆ xmlTextWriterEndDTD()

int xmlTextWriterEndDTD ( xmlTextWriter * writer)

End an xml DTD.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndDTDAttlist()

int xmlTextWriterEndDTDAttlist ( xmlTextWriter * writer)

End an xml DTD attribute list.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndDTDElement()

int xmlTextWriterEndDTDElement ( xmlTextWriter * writer)

End an xml DTD element.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndDTDEntity()

int xmlTextWriterEndDTDEntity ( xmlTextWriter * writer)

End an xml DTD entity.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndElement()

int xmlTextWriterEndElement ( xmlTextWriter * writer)

End the current xml element.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterEndPI()

int xmlTextWriterEndPI ( xmlTextWriter * writer)

End the current xml PI.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterFlush()

int xmlTextWriterFlush ( xmlTextWriter * writer)

Flush the output buffer.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterFullEndElement()

int xmlTextWriterFullEndElement ( xmlTextWriter * writer)

End the current xml element.

Writes an end tag even if the element is empty

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterSetIndent()

int xmlTextWriterSetIndent ( xmlTextWriter * writer,
int indent )

Set indentation output.

indent = 0 do not indentation. indent > 0 do indentation.

Parameters
writerthe xmlTextWriter
indentdo indentation?
Returns
-1 on error or 0 otherwise.

◆ xmlTextWriterSetIndentString()

int xmlTextWriterSetIndentString ( xmlTextWriter * writer,
const xmlChar * str )

Set string indentation.

Parameters
writerthe xmlTextWriter
strthe xmlChar string
Returns
-1 on error or 0 otherwise.

◆ xmlTextWriterSetQuoteChar()

int xmlTextWriterSetQuoteChar ( xmlTextWriter * writer,
xmlChar quotechar )

Set the character used for quoting attributes.

Parameters
writerthe xmlTextWriter
quotecharthe quote character
Returns
-1 on error or 0 otherwise.

◆ xmlTextWriterStartAttribute()

int xmlTextWriterStartAttribute ( xmlTextWriter * writer,
const xmlChar * name )

Start an xml attribute.

Parameters
writerthe xmlTextWriter
nameelement name
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartAttributeNS()

int xmlTextWriterStartAttributeNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI )

Start an xml attribute with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix or NULL
nameelement local name
namespaceURInamespace URI or NULL
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartCDATA()

int xmlTextWriterStartCDATA ( xmlTextWriter * writer)

Start an xml CDATA section.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartComment()

int xmlTextWriterStartComment ( xmlTextWriter * writer)

Start an xml comment.

Parameters
writerthe xmlTextWriter
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartDocument()

int xmlTextWriterStartDocument ( xmlTextWriter * writer,
const char * version,
const char * encoding,
const char * standalone )

Start a new xml document.

Parameters
writerthe xmlTextWriter
versionthe xml version ("1.0") or NULL for default ("1.0")
encodingthe 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

◆ xmlTextWriterStartDTD()

int xmlTextWriterStartDTD ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid )

Start an xml DTD.

Parameters
writerthe xmlTextWriter
namethe name of the DTD
pubidthe public identifier, which is an alternative to the system identifier
sysidthe 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

◆ xmlTextWriterStartDTDAttlist()

int xmlTextWriterStartDTDAttlist ( xmlTextWriter * writer,
const xmlChar * name )

Start an xml DTD ATTLIST.

Parameters
writerthe xmlTextWriter
namethe name of the DTD ATTLIST
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartDTDElement()

int xmlTextWriterStartDTDElement ( xmlTextWriter * writer,
const xmlChar * name )

Start an xml DTD element.

Parameters
writerthe xmlTextWriter
namethe name of the DTD element
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartDTDEntity()

int xmlTextWriterStartDTDEntity ( xmlTextWriter * writer,
int pe,
const xmlChar * name )

Start an xml DTD ATTLIST.

Parameters
writerthe xmlTextWriter
peTRUE if this is a parameter entity, FALSE if not
namethe name of the DTD ATTLIST
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartElement()

int xmlTextWriterStartElement ( xmlTextWriter * writer,
const xmlChar * name )

Start an xml element.

Parameters
writerthe xmlTextWriter
nameelement name
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartElementNS()

int xmlTextWriterStartElementNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI )

Start an xml element with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix or NULL
nameelement local name
namespaceURInamespace URI or NULL
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterStartPI()

int xmlTextWriterStartPI ( xmlTextWriter * writer,
const xmlChar * target )

Start an xml PI.

Parameters
writerthe xmlTextWriter
targetPI target
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteAttribute()

int xmlTextWriterWriteAttribute ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * content )

Write an xml attribute.

Parameters
writerthe xmlTextWriter
nameattribute name
contentattribute content
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteAttributeNS()

int xmlTextWriterWriteAttributeNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content )

Write an xml attribute.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix
nameattribute local name
namespaceURInamespace URI
contentattribute content
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteBase64()

int xmlTextWriterWriteBase64 ( xmlTextWriter * writer,
const char * data,
int start,
int len )

Write an base64 encoded xml text.

Parameters
writerthe xmlTextWriter
databinary data
startthe position within the data of the first byte to encode
lenthe number of bytes to encode
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteBinHex()

int xmlTextWriterWriteBinHex ( xmlTextWriter * writer,
const char * data,
int start,
int len )

Write a BinHex encoded xml text.

Parameters
writerthe xmlTextWriter
databinary data
startthe position within the data of the first byte to encode
lenthe number of bytes to encode
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteCDATA()

int xmlTextWriterWriteCDATA ( xmlTextWriter * writer,
const xmlChar * content )

Write an xml CDATA.

Parameters
writerthe xmlTextWriter
contentCDATA content
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteComment()

int xmlTextWriterWriteComment ( xmlTextWriter * writer,
const xmlChar * content )

Write an xml comment.

Parameters
writerthe xmlTextWriter
contentcomment string
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTD()

int xmlTextWriterWriteDTD ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * subset )

Write a DTD.

Parameters
writerthe xmlTextWriter
namethe name of the DTD
pubidthe public identifier, which is an alternative to the system identifier
sysidthe system identifier, which is the URI of the DTD
subsetstring content of the DTD
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDAttlist()

int xmlTextWriterWriteDTDAttlist ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * content )

Write a DTD ATTLIST.

Parameters
writerthe xmlTextWriter
namethe name of the DTD ATTLIST
contentcontent of the ATTLIST
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDElement()

int xmlTextWriterWriteDTDElement ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * content )

Write a DTD element.

Parameters
writerthe xmlTextWriter
namethe name of the DTD element
contentcontent of the element
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDEntity()

int xmlTextWriterWriteDTDEntity ( xmlTextWriter * writer,
int pe,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid,
const xmlChar * content )

Write a DTD entity.

Parameters
writerthe xmlTextWriter
peTRUE if this is a parameter entity, FALSE if not
namethe name of the DTD entity
pubidthe public identifier, which is an alternative to the system identifier
sysidthe system identifier, which is the URI of the DTD
ndataidthe xml notation name.
contentcontent of the entity
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDExternalEntity()

int xmlTextWriterWriteDTDExternalEntity ( xmlTextWriter * 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

Parameters
writerthe xmlTextWriter
peTRUE if this is a parameter entity, FALSE if not
namethe name of the DTD entity
pubidthe public identifier, which is an alternative to the system identifier
sysidthe system identifier, which is the URI of the DTD
ndataidthe xml notation name.
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDExternalEntityContents()

int xmlTextWriterWriteDTDExternalEntityContents ( xmlTextWriter * writer,
const xmlChar * pubid,
const xmlChar * sysid,
const xmlChar * ndataid )

Write the contents of a DTD external entity.

Parameters
writerthe xmlTextWriter
pubidthe public identifier, which is an alternative to the system identifier
sysidthe system identifier, which is the URI of the DTD
ndataidthe xml notation name.
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDInternalEntity()

int xmlTextWriterWriteDTDInternalEntity ( xmlTextWriter * writer,
int pe,
const xmlChar * name,
const xmlChar * content )

Write a DTD internal entity.

Parameters
writerthe xmlTextWriter
peTRUE if this is a parameter entity, FALSE if not
namethe name of the DTD entity
contentcontent of the entity
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteDTDNotation()

int xmlTextWriterWriteDTDNotation ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid )

Write a DTD entity.

Parameters
writerthe xmlTextWriter
namethe name of the xml notation
pubidthe public identifier, which is an alternative to the system identifier
sysidthe 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

◆ xmlTextWriterWriteElement()

int xmlTextWriterWriteElement ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * content )

Write an xml element.

Parameters
writerthe xmlTextWriter
nameelement name
contentelement content
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteElementNS()

int xmlTextWriterWriteElementNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const xmlChar * content )

Write an xml element with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix
nameelement local name
namespaceURInamespace URI
contentelement content
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatAttribute()

int xmlTextWriterWriteFormatAttribute ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
... )

Write a formatted xml attribute.

Parameters
writerthe xmlTextWriter
nameattribute name
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatAttributeNS()

int xmlTextWriterWriteFormatAttributeNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... )

Write a formatted xml attribute.with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix
nameattribute local name
namespaceURInamespace URI
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatCDATA()

int xmlTextWriterWriteFormatCDATA ( xmlTextWriter * writer,
const char * format,
... )

Write a formatted xml CDATA.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatComment()

int xmlTextWriterWriteFormatComment ( xmlTextWriter * writer,
const char * format,
... )

Write an xml comment.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatDTD()

int xmlTextWriterWriteFormatDTD ( xmlTextWriter * writer,
const xmlChar * name,
const xmlChar * pubid,
const xmlChar * sysid,
const char * format,
... )

Write a DTD with a formatted markup declarations part.

Parameters
writerthe xmlTextWriter
namethe name of the DTD
pubidthe public identifier, which is an alternative to the system identifier
sysidthe system identifier, which is the URI of the DTD
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatDTDAttlist()

int xmlTextWriterWriteFormatDTDAttlist ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
... )

Write a formatted DTD ATTLIST.

Parameters
writerthe xmlTextWriter
namethe name of the DTD ATTLIST
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatDTDElement()

int xmlTextWriterWriteFormatDTDElement ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
... )

Write a formatted DTD element.

Parameters
writerthe xmlTextWriter
namethe name of the DTD element
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatDTDInternalEntity()

int xmlTextWriterWriteFormatDTDInternalEntity ( xmlTextWriter * writer,
int pe,
const xmlChar * name,
const char * format,
... )

Write a formatted DTD internal entity.

Parameters
writerthe xmlTextWriter
peTRUE if this is a parameter entity, FALSE if not
namethe name of the DTD entity
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatElement()

int xmlTextWriterWriteFormatElement ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
... )

Write a formatted xml element.

Parameters
writerthe xmlTextWriter
nameelement name
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatElementNS()

int xmlTextWriterWriteFormatElementNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
... )

Write a formatted xml element with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix
nameelement local name
namespaceURInamespace URI
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatPI()

int xmlTextWriterWriteFormatPI ( xmlTextWriter * writer,
const xmlChar * target,
const char * format,
... )

Write a formatted PI.

Parameters
writerthe xmlTextWriter
targetPI target
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatRaw()

int xmlTextWriterWriteFormatRaw ( xmlTextWriter * writer,
const char * format,
... )

Write a formatted raw xml text.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteFormatString()

int xmlTextWriterWriteFormatString ( xmlTextWriter * writer,
const char * format,
... )

Write a formatted xml text.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
...extra parameters for the format
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWritePI()

int xmlTextWriterWritePI ( xmlTextWriter * writer,
const xmlChar * target,
const xmlChar * content )

Write an xml PI.

Parameters
writerthe xmlTextWriter
targetPI target
contentPI content
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteRaw()

int xmlTextWriterWriteRaw ( xmlTextWriter * writer,
const xmlChar * content )

Write a raw xml text.

Parameters
writerthe xmlTextWriter
contenttext string
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteRawLen()

int xmlTextWriterWriteRawLen ( xmlTextWriter * writer,
const xmlChar * content,
int len )

Write an xml text.

TODO: what about entities and special chars??

Parameters
writerthe xmlTextWriter
contenttext string
lenlength of the text string
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteString()

int xmlTextWriterWriteString ( xmlTextWriter * writer,
const xmlChar * content )

Write an xml text.

Parameters
writerthe xmlTextWriter
contenttext string
Returns
the bytes written (may be 0 because of buffering) or -1 in case of error

◆ xmlTextWriterWriteVFormatAttribute()

int xmlTextWriterWriteVFormatAttribute ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
va_list argptr )

Write a formatted xml attribute.

Parameters
writerthe xmlTextWriter
nameattribute name
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatAttributeNS()

int xmlTextWriterWriteVFormatAttributeNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr )

Write a formatted xml attribute.with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix
nameattribute local name
namespaceURInamespace URI
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatCDATA()

int xmlTextWriterWriteVFormatCDATA ( xmlTextWriter * writer,
const char * format,
va_list argptr )

Write a formatted xml CDATA.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatComment()

int xmlTextWriterWriteVFormatComment ( xmlTextWriter * writer,
const char * format,
va_list argptr )

Write an xml comment.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatDTD()

int xmlTextWriterWriteVFormatDTD ( xmlTextWriter * 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.

Parameters
writerthe xmlTextWriter
namethe name of the DTD
pubidthe public identifier, which is an alternative to the system identifier
sysidthe system identifier, which is the URI of the DTD
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatDTDAttlist()

int xmlTextWriterWriteVFormatDTDAttlist ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
va_list argptr )

Write a formatted DTD ATTLIST.

Parameters
writerthe xmlTextWriter
namethe name of the DTD ATTLIST
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatDTDElement()

int xmlTextWriterWriteVFormatDTDElement ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
va_list argptr )

Write a formatted DTD element.

Parameters
writerthe xmlTextWriter
namethe name of the DTD element
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatDTDInternalEntity()

int xmlTextWriterWriteVFormatDTDInternalEntity ( xmlTextWriter * writer,
int pe,
const xmlChar * name,
const char * format,
va_list argptr )

Write a formatted DTD internal entity.

Parameters
writerthe xmlTextWriter
peTRUE if this is a parameter entity, FALSE if not
namethe name of the DTD entity
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatElement()

int xmlTextWriterWriteVFormatElement ( xmlTextWriter * writer,
const xmlChar * name,
const char * format,
va_list argptr )

Write a formatted xml element.

Parameters
writerthe xmlTextWriter
nameelement name
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatElementNS()

int xmlTextWriterWriteVFormatElementNS ( xmlTextWriter * writer,
const xmlChar * prefix,
const xmlChar * name,
const xmlChar * namespaceURI,
const char * format,
va_list argptr )

Write a formatted xml element with namespace support.

Parameters
writerthe xmlTextWriter
prefixnamespace prefix
nameelement local name
namespaceURInamespace URI
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatPI()

int xmlTextWriterWriteVFormatPI ( xmlTextWriter * writer,
const xmlChar * target,
const char * format,
va_list argptr )

Write a formatted xml PI.

Parameters
writerthe xmlTextWriter
targetPI target
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatRaw()

int xmlTextWriterWriteVFormatRaw ( xmlTextWriter * writer,
const char * format,
va_list argptr )

Write a formatted raw xml text.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
argptrpointer 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

◆ xmlTextWriterWriteVFormatString()

int xmlTextWriterWriteVFormatString ( xmlTextWriter * writer,
const char * format,
va_list argptr )

Write a formatted xml text.

Parameters
writerthe xmlTextWriter
formatformat string (see printf)
argptrpointer 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