libxml2

Loading...
Searching...
No Matches
Macros | Typedefs | Functions
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
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.)
xmlTextWriter * | xmlNewTextWriterFilename (const char *uri, int compression)
| Create a new xmlTextWriter structure with `uri` as output.
xmlTextWriter * | xmlNewTextWriterMemory (xmlBuffer *buf, int compression)
| Create a new xmlTextWriter structure with `buf` as output TODO: handle compression.
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).
xmlTextWriter * | xmlNewTextWriterDoc (xmlDoc **doc, int compression)
| Create a new xmlTextWriter structure with `doc` as output.
xmlTextWriter * | xmlNewTextWriterTree (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

Copyright
  See Copyright for the status of this software.

Author
  Alfred Mickautsch

## Function Documentation

## ◆ xmlFreeTextWriter()

void xmlFreeTextWriter | ( | xmlTextWriter * | writer | ) |

Deallocate all the resources associated to the writer.

Parameters

  writer | the 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

  out | an 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

  doc | address of a xmlDoc to hold the new XML document tree
  compression | compress 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

  uri | the URI of the resource for the output
  compression | compress 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

  buf | xmlBuffer
  compression | compress 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

  ctxt | xmlParserCtxt to hold the new XML document tree
  compression | compress 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

  doc | xmlDoc
  node | xmlNode or NULL for doc->children
  compression | compress 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

  writer | the xmlTextWriter

Returns
  an xmlParserErrors code.

## ◆ xmlTextWriterEndAttribute()

int xmlTextWriterEndAttribute | ( | xmlTextWriter * | writer | ) |

End the current xml element.

Parameters

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the xmlTextWriter

Returns
  the bytes written or -1 in case of error

## ◆ xmlTextWriterEndDTD()

int xmlTextWriterEndDTD | ( | xmlTextWriter * | writer | ) |

End an xml DTD.

Parameters

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the 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

  writer | the xmlTextWriter
  indent | do indentation?

Returns
  -1 on error or 0 otherwise.

## ◆ xmlTextWriterSetIndentString()

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

Set string indentation.

Parameters

  writer | the xmlTextWriter
  str | the xmlChar string

Returns
  -1 on error or 0 otherwise.

## ◆ xmlTextWriterSetQuoteChar()

int xmlTextWriterSetQuoteChar | ( | xmlTextWriter * | writer,
|  | xmlChar | quotechar
| ) |  |

Set the character used for quoting attributes.

Parameters

  writer | the xmlTextWriter
  quotechar | the quote character

Returns
  -1 on error or 0 otherwise.

## ◆ xmlTextWriterStartAttribute()

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

Start an xml attribute.

Parameters

  writer | the xmlTextWriter
  name | element 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterStartCDATA()

int xmlTextWriterStartCDATA | ( | xmlTextWriter * | writer | ) |

Start an xml CDATA section.

Parameters

  writer | the 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

  writer | the 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterStartDTD()

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

Start an xml DTD.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterStartDTDAttlist()

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

Start an xml DTD ATTLIST.

Parameters

  writer | the xmlTextWriter
  name | the 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

  writer | the xmlTextWriter
  name | the 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterStartElement()

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

Start an xml element.

Parameters

  writer | the xmlTextWriter
  name | element 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterStartPI()

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

Start an xml PI.

Parameters

  writer | the xmlTextWriter
  target | PI 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

  writer | the xmlTextWriter
  name | attribute name
  content | attribute 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteBase64()

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

Write an base64 encoded xml text.

Parameters

  writer | the xmlTextWriter
  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

NOTE: No safety check is done on the length of data. This check is something that should happen outside of this call, the caller should know better the actual data and if it's reaching the end of the buffer or not.

## ◆ xmlTextWriterWriteBinHex()

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

Write a BinHex encoded xml text.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteCDATA()

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

Write an xml CDATA.

Parameters

  writer | the xmlTextWriter
  content | CDATA 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

  writer | the xmlTextWriter
  content | comment 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteDTDAttlist()

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

Write a DTD ATTLIST.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteDTDElement()

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

Write a DTD element.

Parameters

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteDTDExternalEntityContents()

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

Write the contents of a DTD external entity.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteDTDInternalEntity()

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

Write a DTD internal entity.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteDTDNotation()

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

Write a DTD entity.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteElement()

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

Write an xml element.

Parameters

  writer | the xmlTextWriter
  name | element name
  content | element 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatAttribute()

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

Write a formatted xml attribute.

Parameters

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatCDATA()

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

Write a formatted xml CDATA.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatComment()

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

Write an xml comment.

Parameters

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatDTDAttlist()

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

Write a formatted DTD ATTLIST.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatDTDElement()

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

Write a formatted DTD element.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatDTDInternalEntity()

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

Write a formatted DTD internal entity.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatElement()

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

Write a formatted xml element.

Parameters

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatPI()

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

Write a formatted PI.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatRaw()

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

Write a formatted raw xml text.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteFormatString()

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

Write a formatted xml text.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWritePI()

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

Write an xml PI.

Parameters

  writer | the xmlTextWriter
  target | PI target
  content | PI 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

  writer | the xmlTextWriter
  content | text 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteString()

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

Write an xml text.

Parameters

  writer | the xmlTextWriter
  content | text 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

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatCDATA()

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

Write a formatted xml CDATA.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatComment()

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

Write an xml comment.

Parameters

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatDTDAttlist()

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

Write a formatted DTD ATTLIST.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatDTDElement()

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

Write a formatted DTD element.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatDTDInternalEntity()

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

Write a formatted DTD internal entity.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatElement()

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

Write a formatted xml element.

Parameters

  writer | the xmlTextWriter
  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

## ◆ 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

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatPI()

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

Write a formatted xml PI.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatRaw()

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

Write a formatted raw xml text.

Parameters

  writer | the xmlTextWriter
  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

## ◆ xmlTextWriterWriteVFormatString()

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

Write a formatted xml text.

Parameters

  writer | the xmlTextWriter
  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