diff --git a/doc/mxml.3 b/doc/mxml.3 index b54bb57..05504e6 100644 --- a/doc/mxml.3 +++ b/doc/mxml.3 @@ -1,4 +1,4 @@ -.TH mxml 3 "Mini-XML API" "2019-02-20" "Mini-XML API" +.TH mxml 3 "Mini-XML API" "2019-03-01" "Mini-XML API" .SH NAME mxml \- Mini-XML API .SH INCLUDE FILE diff --git a/doc/mxml.epub b/doc/mxml.epub index 1715392..863e9d9 100644 Binary files a/doc/mxml.epub and b/doc/mxml.epub differ diff --git a/doc/mxml.html b/doc/mxml.html index 6ba32bc..e8f407c 100644 --- a/doc/mxml.html +++ b/doc/mxml.html @@ -3,91 +3,62 @@ Mini-XML API Reference - + -

-

Mini-XML API Reference

-

Michael R Sweet

-

Copyright © 2003-2019, All Rights Reserved.

+
+

+

Mini-XML API Reference

+

Michael R Sweet

+

Copyright © 2003-2019, All Rights Reserved.

+

Contents

-

Introduction

+

Introduction

Mini-XML is a small XML parsing library that you can use to read XML data files or strings in your application without requiring large non-standard libraries. Mini-XML provides the following functionality:

Mini-XML doesn't do validation or other types of processing on the data based upon schema files or other sources of definition information.

-

History

+

History

Mini-XML was initially developed for the Gutenprint project to replace the rather large and unwieldy libxml2 library with something substantially smaller and easier-to-use. It all began one morning in June of 2003 when Robert posted the following sentence to the developer's list:

It's bad enough that we require libxml2, but rolling our own XML parser is a bit more than we can handle.

@@ -325,14 +315,14 @@ h3.title {

I took my own challenge and coded furiously for two days to produced the initial public release of Mini-XML, total lines of code: 696. Robert promptly integrated Mini-XML into Gutenprint and removed libxml2.

Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML implementation and now stands at a whopping 4,115 lines of code, compared to 140,410 lines of code for libxml2 version 2.9.1.

-

Resources

+

Resources

The Mini-XML home page can be found at:

https://www.msweet.orgm/mxml
 

From here you can download the current version of Mini-XML, the issue tracker, and other resources.

-

Legal Stuff

+

The Mini-XML library is copyright © 2003-2019 by Michael R Sweet and is provided under the Apache License Version 2.0 with an exception to allow linking against GPL2/LGPL2-only software. See the files "LICENSE" and "NOTICE" for more information.

-

Using Mini-XML

+

Using Mini-XML

Mini-XML provides a single header file which you include:

#include <mxml.h>
 
@@ -342,7 +332,7 @@ h3.title {

If you have the pkg-config software installed, you can use it to determine the proper compiler and linker options for your installation:

gcc `pkg-config --cflags mxml` -o myprogram myprogram.c `pkg-config --libs mxml`
 
-

Loading an XML File

+

Loading an XML File

You load an XML file using the mxmlLoadFile function:

mxml_node_t *
 mxmlLoadFile(mxml_node_t *top, FILE *fp,
@@ -365,7 +355,7 @@ mxml_node_t *
 mxmlLoadString(mxml_node_t *top, const char *s,
                mxml_type_t (*cb)(mxml_node_t *));
 
-

Load Callbacks

+

Load Callbacks

The last argument to the mxmlLoad functions is a callback function which is used to determine the value type of each data node in an XML document. Mini-XML defines several standard callbacks for simple XML data files:

-

Iterating Nodes

+

Iterating Nodes

While the mxmlFindNode and mxmlFindPath functions will find a particular element node, sometimes you need to iterate over all nodes. The mxmlWalkNext and mxmlWalkPrev functions can be used to iterate through the XML node tree:

mxml_node_t *
 mxmlWalkNext(mxml_node_t *node, mxml_node_t *top,
@@ -821,7 +819,7 @@ val7
 <node>
 val8
 
-

Indexing

+

Indexing

The mxmlIndexNew function allows you to create an index of nodes for faster searching and enumeration:

mxml_index_t *
 mxmlIndexNew(mxml_node_t *node, const char *element,
@@ -864,7 +862,7 @@ mxmlIndexGetCount(mxml_index_t *ind);
     
void
 mxmlIndexDelete(mxml_index_t *ind);
 
-

Custom Data Types

+

Custom Data Types

Mini-XML supports custom data types via per-thread load and save callbacks. Only a single set of callbacks can be active at any time for the current thread, however your callbacks can store additional information in order to support multiple custom data types as needed. The MXML_CUSTOM node type identifies custom data nodes.

The mxmlGetCustom function retrieves the custom value pointer for a node.

const void *
@@ -996,7 +994,7 @@ save_custom(mxml_node_t *node)
     

You register the callback functions using the mxmlSetCustomHandlers function:

mxmlSetCustomHandlers(load_custom, save_custom);
 
-

SAX (Stream) Loading of Documents

+

SAX (Stream) Loading of Documents

Mini-XML supports an implementation of the Simple API for XML (SAX) which allows you to load and process an XML document as a stream of nodes. Aside from allowing you to process XML documents of any size, the Mini-XML implementation also allows you to retain portions of the document in memory for later processing.

The mxmlSAXLoadFd, mxmlSAXLoadFile, and mxmlSAXLoadString functions provide the SAX loading APIs:

mxml_node_t *