diff --git a/doc/docset.intro b/doc/docset.intro index 731ba66..fa11c99 100644 --- a/doc/docset.intro +++ b/doc/docset.intro @@ -23,7 +23,7 @@ #include <mxml.h> -
Nodes are defined by the "mxml_node_t" structure; +
Nodes are defined by the "mxml_node_t" structure; the "type" member defines the node type (element, integer, opaque, real, or text) which determines which value you want to look at in the "value" union. New nodes can be created using the diff --git a/doc/reference.html b/doc/reference.html index 9b24f99..dc477d9 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -241,10 +241,10 @@ using a SAX callback.">mxmlSAXLoadString
Add a node to a tree.
void mxmlAdd (
- mxml_node_t *parent,
- int where,
- mxml_node_t *child,
- mxml_node_t *node
+ mxml_node_t *parent,
+ int where,
+ mxml_node_t *child,
+ mxml_node_t *node
);
Delete a node and all of its children.
void mxmlDelete (
- mxml_node_t *node
+ mxml_node_t *node
);
If the specified node has a parent, this function first removes the node from its parent using the mxmlRemove() function.
-Delete an attribute.
void mxmlElementDeleteAttr (
- mxml_node_t *node,
- const char *name
+ mxml_node_t *node,
+ const char *name
);
Get an attribute.
const char *mxmlElementGetAttr (
- mxml_node_t *node,
- const char *name
+ mxml_node_t *node,
+ const char *name
);
Set an attribute.
void mxmlElementSetAttr (
- mxml_node_t *node,
- const char *name,
- const char *value
+ mxml_node_t *node,
+ const char *name,
+ const char *value
);
Set an attribute with a formatted value.
void mxmlElementSetAttrf (
- mxml_node_t *node,
- const char *name,
- const char *format,
- ...
+ mxml_node_t *node,
+ const char *name,
+ const char *format,
+ ...
);
Add a callback to convert entities to Unicode.
int mxmlEntityAddCallback (
- mxml_entity_cb_t cb
+ mxml_entity_cb_t cb
);
Get the name that corresponds to the character value.
const char *mxmlEntityGetName (
- int val
+ int val
);
Get the character corresponding to a named entity.
int mxmlEntityGetValue (
- const char *name
+ const char *name
);
Remove a callback.
void mxmlEntityRemoveCallback (
- mxml_entity_cb_t cb
+ mxml_entity_cb_t cb
);
Find the named element.
mxml_node_t *mxmlFindElement (
- mxml_node_t *node,
- mxml_node_t *top,
- const char *name,
- const char *attr,
- const char *value,
- int descend
+ mxml_node_t *node,
+ mxml_node_t *top,
+ const char *name,
+ const char *attr,
+ const char *value,
+ int descend
);
Find a node with the given path.
mxml_node_t *mxmlFindPath (
- mxml_node_t *top,
- const char *path
+ mxml_node_t *top,
+ const char *path
);
Get the value for a CDATA node.
const char *mxmlGetCDATA (
- mxml_node_t *node
+ mxml_node_t *node
);
NULL
is returned if the node is not a CDATA element.
Get the value for a custom node.
const void *mxmlGetCustom (
- mxml_node_t *node
+ mxml_node_t *node
);
Get the name for an element node.
const char *mxmlGetElement (
- mxml_node_t *node
+ mxml_node_t *node
);
NULL
is returned if the node is not an element node.
Get the first child of an element node.
mxml_node_t *mxmlGetFirstChild (
- mxml_node_t *node
+ mxml_node_t *node
);
Get the integer value from the specified node or its first child.
int mxmlGetInteger (
- mxml_node_t *node
+ mxml_node_t *node
);
0 is returned if the node (or its first child) is not an integer value node.
-Get the last child of an element node.
mxml_node_t *mxmlGetLastChild (
- mxml_node_t *node
+ mxml_node_t *node
);
Return the node type...
mxml_node_t *mxmlGetNextSibling (
- mxml_node_t *node
+ mxml_node_t *node
);
NULL
is returned if this is the last child for the current parent.
Get an opaque string value for a node or its first child.
const char *mxmlGetOpaque (
- mxml_node_t *node
+ mxml_node_t *node
);
Get the parent node.
mxml_node_t *mxmlGetParent (
- mxml_node_t *node
+ mxml_node_t *node
);
NULL
is returned for a root node.
Get the previous node for the current parent.
mxml_node_t *mxmlGetPrevSibling (
- mxml_node_t *node
+ mxml_node_t *node
);
NULL
is returned if this is the first child for the current parent.
Get the real value for a node or its first child.
double mxmlGetReal (
- mxml_node_t *node
+ mxml_node_t *node
);
0.0 is returned if the node (or its first child) is not a real value node.
-Get the current reference (use) count for a node.
int mxmlGetRefCount (
- mxml_node_t *node
+ mxml_node_t *node
);
mxmlRelease
functions to increment a
reference count.
.
-Get the text value for a node or its first child.
const char *mxmlGetText (
- mxml_node_t *node,
- int *whitespace
+ mxml_node_t *node,
+ int *whitespace
);
Get the node type.
mxml_type_t mxmlGetType (
- mxml_node_t *node
+ mxml_node_t *node
);
MXML_IGNORE
is returned if "node" is NULL
.
Get the user data pointer for a node.
void *mxmlGetUserData (
- mxml_node_t *node
+ mxml_node_t *node
);
Delete an index.
void mxmlIndexDelete (
- mxml_index_t *ind
+ mxml_index_t *ind
);
Return the next node in the index.
mxml_node_t *mxmlIndexEnum (
- mxml_index_t *ind
+ mxml_index_t *ind
);
Find the next matching node.
mxml_node_t *mxmlIndexFind (
- mxml_index_t *ind,
- const char *element,
- const char *value
+ mxml_index_t *ind,
+ const char *element,
+ const char *value
);
Get the number of nodes in an index.
int mxmlIndexGetCount (
- mxml_index_t *ind
+ mxml_index_t *ind
);
Create a new index.
mxml_index_t *mxmlIndexNew (
- mxml_node_t *node,
- const char *element,
- const char *attr
+ mxml_node_t *node,
+ const char *element,
+ const char *attr
);
mxml_node_t *mxmlIndexReset (
- mxml_index_t *ind
+ mxml_index_t *ind
);
Load a file descriptor into an XML node tree.
mxml_node_t *mxmlLoadFd (
- mxml_node_t *top,
- int fd,
- mxml_load_cb_t cb
+ mxml_node_t *top,
+ int fd,
+ mxml_load_cb_t cb
);
Load a file into an XML node tree.
mxml_node_t *mxmlLoadFile (
- mxml_node_t *top,
- FILE *fp,
- mxml_load_cb_t cb
+ mxml_node_t *top,
+ FILE *fp,
+ mxml_load_cb_t cb
);
Load a string into an XML node tree.
mxml_node_t *mxmlLoadString (
- mxml_node_t *top,
- const char *s,
- mxml_load_cb_t cb
+ mxml_node_t *top,
+ const char *s,
+ mxml_load_cb_t cb
);
Create a new CDATA node.
mxml_node_t *mxmlNewCDATA (
- mxml_node_t *parent,
- const char *data
+ mxml_node_t *parent,
+ const char *data
);
Create a new custom data node.
mxml_node_t *mxmlNewCustom (
- mxml_node_t *parent,
- void *data,
- mxml_custom_destroy_cb_t destroy
+ mxml_node_t *parent,
+ void *data,
+ mxml_custom_destroy_cb_t destroy
);
Create a new element node.
mxml_node_t *mxmlNewElement (
- mxml_node_t *parent,
- const char *name
+ mxml_node_t *parent,
+ const char *name
);
Create a new integer node.
mxml_node_t *mxmlNewInteger (
- mxml_node_t *parent,
- int integer
+ mxml_node_t *parent,
+ int integer
);
Create a new opaque string.
mxml_node_t *mxmlNewOpaque (
- mxml_node_t *parent,
- const char *opaque
+ mxml_node_t *parent,
+ const char *opaque
);
Create a new real number node.
mxml_node_t *mxmlNewReal (
- mxml_node_t *parent,
- double real
+ mxml_node_t *parent,
+ double real
);
Create a new text fragment node.
mxml_node_t *mxmlNewText (
- mxml_node_t *parent,
- int whitespace,
- const char *string
+ mxml_node_t *parent,
+ int whitespace,
+ const char *string
);
Create a new formatted text fragment node.
mxml_node_t *mxmlNewTextf (
- mxml_node_t *parent,
- int whitespace,
- const char *format,
- ...
+ mxml_node_t *parent,
+ int whitespace,
+ const char *format,
+ ...
);
Create a new XML document tree.
mxml_node_t *mxmlNewXML (
- const char *version
+ const char *version
);
Release a node.
int mxmlRelease (
- mxml_node_t *node
+ mxml_node_t *node
);
Remove a node from its parent.
void mxmlRemove (
- mxml_node_t *node
+ mxml_node_t *node
);
Does not free memory used by the node - use mxmlDelete() for that. This function does nothing if the node has no parent.
-Retain a node.
int mxmlRetain (
- mxml_node_t *node
+ mxml_node_t *node
);
New reference count
-Load a file descriptor into an XML node tree using a SAX callback.
mxml_node_t *mxmlSAXLoadFd (
- mxml_node_t *top,
- int fd,
- mxml_load_cb_t cb,
- mxml_sax_cb_t sax_cb,
- void *sax_data
+ mxml_node_t *top,
+ int fd,
+ mxml_load_cb_t cb,
+ mxml_sax_cb_t sax_cb,
+ void *sax_data
);
Load a file into an XML node tree using a SAX callback.
mxml_node_t *mxmlSAXLoadFile (
- mxml_node_t *top,
- FILE *fp,
- mxml_load_cb_t cb,
- mxml_sax_cb_t sax_cb,
- void *sax_data
+ mxml_node_t *top,
+ FILE *fp,
+ mxml_load_cb_t cb,
+ mxml_sax_cb_t sax_cb,
+ void *sax_data
);
Load a string into an XML node tree using a SAX callback.
mxml_node_t *mxmlSAXLoadString (
- mxml_node_t *top,
- const char *s,
- mxml_load_cb_t cb,
- mxml_sax_cb_t sax_cb,
- void *sax_data
+ mxml_node_t *top,
+ const char *s,
+ mxml_load_cb_t cb,
+ mxml_sax_cb_t sax_cb,
+ void *sax_data
);
Save an XML tree to an allocated string.
char *mxmlSaveAllocString (
- mxml_node_t *node,
- mxml_save_cb_t cb
+ mxml_node_t *node,
+ mxml_save_cb_t cb
);
Save an XML tree to a file descriptor.
int mxmlSaveFd (
- mxml_node_t *node,
- int fd,
- mxml_save_cb_t cb
+ mxml_node_t *node,
+ int fd,
+ mxml_save_cb_t cb
);
Save an XML tree to a file.
int mxmlSaveFile (
- mxml_node_t *node,
- FILE *fp,
- mxml_save_cb_t cb
+ mxml_node_t *node,
+ FILE *fp,
+ mxml_save_cb_t cb
);
Save an XML node tree to a string.
int mxmlSaveString (
- mxml_node_t *node,
- char *buffer,
- int bufsize,
- mxml_save_cb_t cb
+ mxml_node_t *node,
+ char *buffer,
+ int bufsize,
+ mxml_save_cb_t cb
);
Set the element name of a CDATA node.
int mxmlSetCDATA (
- mxml_node_t *node,
- const char *data
+ mxml_node_t *node,
+ const char *data
);
The node is not changed if it (or its first child) is not a CDATA element node.
-Set the data and destructor of a custom data node.
int mxmlSetCustom (
- mxml_node_t *node,
- void *data,
- mxml_custom_destroy_cb_t destroy
+ mxml_node_t *node,
+ void *data,
+ mxml_custom_destroy_cb_t destroy
);
Set the handling functions for custom data.
void mxmlSetCustomHandlers (
- mxml_custom_load_cb_t load,
- mxml_custom_save_cb_t save
+ mxml_custom_load_cb_t load,
+ mxml_custom_save_cb_t save
);
Set the name of an element node.
int mxmlSetElement (
- mxml_node_t *node,
- const char *name
+ mxml_node_t *node,
+ const char *name
);
Set the error message callback.
void mxmlSetErrorCallback (
- mxml_error_cb_t cb
+ mxml_error_cb_t cb
);
Set the value of an integer node.
int mxmlSetInteger (
- mxml_node_t *node,
- int integer
+ mxml_node_t *node,
+ int integer
);
Set the value of an opaque node.
int mxmlSetOpaque (
- mxml_node_t *node,
- const char *opaque
+ mxml_node_t *node,
+ const char *opaque
);
Set the value of a real number node.
int mxmlSetReal (
- mxml_node_t *node,
- double real
+ mxml_node_t *node,
+ double real
);
Set the value of a text node.
int mxmlSetText (
- mxml_node_t *node,
- int whitespace,
- const char *string
+ mxml_node_t *node,
+ int whitespace,
+ const char *string
);
Set the value of a text node to a formatted string.
int mxmlSetTextf (
- mxml_node_t *node,
- int whitespace,
- const char *format,
- ...
+ mxml_node_t *node,
+ int whitespace,
+ const char *format,
+ ...
);
0 on success, -1 on failure
The node is not changed if it (or its first child) is not a text node.
-Set the user data pointer for a node.
int mxmlSetUserData (
- mxml_node_t *node,
- void *data
+ mxml_node_t *node,
+ void *data
);
0 on success, -1 on failure
-Set the wrap margin when saving XML data.
void mxmlSetWrapMargin (
- int column
+ int column
);
Walk to the next logical node in the tree.
mxml_node_t *mxmlWalkNext (
- mxml_node_t *node,
- mxml_node_t *top,
- int descend
+ mxml_node_t *node,
+ mxml_node_t *top,
+ int descend
);
Walk to the previous logical node in the tree.
mxml_node_t *mxmlWalkPrev (
- mxml_node_t *node,
- mxml_node_t *top,
- int descend
+ mxml_node_t *node,
+ mxml_node_t *top,
+ int descend
);
The XML node type.
", fp); - write_string(fp, author, OUTPUT_HTML); + write_string(fp, author, OUTPUT_EPUB); fputs("
\n", fp); fputs("", fp); - write_string(fp, copyright, OUTPUT_HTML); + write_string(fp, copyright, OUTPUT_EPUB); fputs("
\n", fp); fputs("