#include <stdio.h>
#include "buffer.h"
#include "structure.h"
Go to the source code of this file.
|
#define | BAD_CAST (xmlChar *) |
|
#define | LIBXML_TEST_VERSION |
|
#define | xmlCleanupParser() |
|
|
typedef unsigned char | xmlChar |
|
typedef xmlBuffer * | xmlBufferPtr |
|
typedef struct MOBIXmlState | MOBIXmlState |
| Xml writer states list structure First element in the list is currently processed element. Last element is root of the document.
|
|
typedef xmlTextWriter * | xmlTextWriterPtr |
|
|
enum | MOBI_XML_MODE { MOBI_XMLMODE_NONE = 0
, MOBI_XMLMODE_NAME
, MOBI_XMLMODE_ATTR
, MOBI_XMLMODE_TEXT
} |
| Xml writer states.
|
|
|
xmlBufferPtr | xmlBufferCreate (void) |
| Create xml buffer. More...
|
|
void | xmlBufferFree (xmlBufferPtr buf) |
| Free XML buffer. More...
|
|
xmlTextWriterPtr | xmlNewTextWriterMemory (xmlBufferPtr xmlbuf, int compression) |
| Initialize TextWriter structure. More...
|
|
void | xmlFreeTextWriter (xmlTextWriterPtr writer) |
| Deallocate TextWriter instance and all its resources. More...
|
|
int | xmlTextWriterStartDocument (xmlTextWriterPtr writer, const char *version, const char *encoding, const char *standalone) |
| Start xml document. More...
|
|
int | xmlTextWriterEndDocument (xmlTextWriterPtr writer) |
| End xml document. More...
|
|
int | xmlTextWriterStartElement (xmlTextWriterPtr writer, const xmlChar *name) |
| Start xml element. More...
|
|
int | xmlTextWriterEndElement (xmlTextWriterPtr writer) |
| End current element. More...
|
|
int | xmlTextWriterWriteAttribute (xmlTextWriterPtr writer, const xmlChar *name, const xmlChar *content) |
| Write attribute with given name and content. More...
|
|
int | xmlTextWriterEndAttribute (xmlTextWriterPtr writer) |
| End current attribute. More...
|
|
int | xmlTextWriterWriteAttributeNS (xmlTextWriterPtr writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const xmlChar *content) |
| Write attribute with namespace support. More...
|
|
int | xmlTextWriterStartElementNS (xmlTextWriterPtr writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI) |
| Start element with namespace support. More...
|
|
int | xmlTextWriterWriteElementNS (xmlTextWriterPtr writer, const xmlChar *prefix, const xmlChar *name, const xmlChar *namespaceURI, const xmlChar *content) |
| Write element with namespace support. More...
|
|
int | xmlTextWriterWriteString (xmlTextWriterPtr writer, const xmlChar *content) |
| Write xml string. More...
|
|
int | xmlTextWriterSetIndent (xmlTextWriterPtr writer, int indent) |
| Set indentation option. More...
|
|
Copyright (c) 2016 Bartek Fabiszewski http://www.fabiszewski.net
This file is part of libmobi. Licensed under LGPL, either version 3, or any later. See http://www.gnu.org/licenses/
◆ xmlBufferCreate()
Create xml buffer.
Libxml2 compatibility wrapper for MOBIBuffer structure. Must be deallocated with xmlBufferFree
- Returns
- Buffer pointer
◆ xmlBufferFree()
Free XML buffer.
- Parameters
-
◆ xmlFreeTextWriter()
Deallocate TextWriter instance and all its resources.
- Parameters
-
◆ xmlNewTextWriterMemory()
Initialize TextWriter structure.
- Parameters
-
[in] | xmlbuf | Initialized xml output buffer |
[in] | compression | Unused |
- Returns
- TextWriter pointer
◆ xmlTextWriterEndAttribute()
End current attribute.
- Parameters
-
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterEndDocument()
End xml document.
All open elements will be closed. xmlBuffer will be flushed.
- Parameters
-
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterEndElement()
End current element.
- Parameters
-
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterSetIndent()
Set indentation option.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | indent | Indent output if value greater than zero |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterStartDocument()
int xmlTextWriterStartDocument |
( |
xmlTextWriterPtr |
writer, |
|
|
const char * |
version, |
|
|
const char * |
encoding, |
|
|
const char * |
standalone |
|
) |
| |
Start xml document.
Only utf-8 encoding supported.
- Parameters
-
[in] | writer | TextWriter |
[in] | version | Value of version attribute, "1.0" if NULL |
[in] | encoding | Unused, defaults to utf-8 |
[in] | standalone | Unused, omitted in declaration |
- Returns
- TextWriter pointer
◆ xmlTextWriterStartElement()
Start xml element.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | name | Element name |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterStartElementNS()
int xmlTextWriterStartElementNS |
( |
xmlTextWriterPtr |
writer, |
|
|
const xmlChar * |
prefix, |
|
|
const xmlChar * |
name, |
|
|
const xmlChar * |
namespaceURI |
|
) |
| |
Start element with namespace support.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | prefix | Namespace prefix or NULL |
[in] | name | Element name |
[in] | namespaceURI | Namespace uri or NULL |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterWriteAttribute()
int xmlTextWriterWriteAttribute |
( |
xmlTextWriterPtr |
writer, |
|
|
const xmlChar * |
name, |
|
|
const xmlChar * |
content |
|
) |
| |
Write attribute with given name and content.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | name | Attribute name |
[in] | content | Attribute content |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterWriteAttributeNS()
int xmlTextWriterWriteAttributeNS |
( |
xmlTextWriterPtr |
writer, |
|
|
const xmlChar * |
prefix, |
|
|
const xmlChar * |
name, |
|
|
const xmlChar * |
namespaceURI, |
|
|
const xmlChar * |
content |
|
) |
| |
Write attribute with namespace support.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | prefix | Namespace prefix or NULL |
[in] | name | Attribute name |
[in] | namespaceURI | Namespace uri or NULL |
[in] | content | Attribute content |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterWriteElementNS()
int xmlTextWriterWriteElementNS |
( |
xmlTextWriterPtr |
writer, |
|
|
const xmlChar * |
prefix, |
|
|
const xmlChar * |
name, |
|
|
const xmlChar * |
namespaceURI, |
|
|
const xmlChar * |
content |
|
) |
| |
Write element with namespace support.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | prefix | Namespace prefix or NULL |
[in] | name | Element name |
[in] | namespaceURI | Namespace uri or NULL |
[in] | content | Element content |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure
◆ xmlTextWriterWriteString()
int xmlTextWriterWriteString |
( |
xmlTextWriterPtr |
writer, |
|
|
const xmlChar * |
content |
|
) |
| |
Write xml string.
- Parameters
-
[in,out] | writer | TextWriter |
[in] | content | Attribute content |
- Returns
- XML_OK (0) on success, XML_ERROR (-1) on failure