");
for ($i = 0; $i <= 5; $i ++)
@@ -267,14 +260,14 @@ else
}
else
{
- print(" \n");
- print(" \n");
+ print(" \n");
+ print(" \n");
}
if ($id)
- print(" \n");
+ print(" \n");
else
- print(" \n");
+ print(" \n");
print("\n"
."\n");
@@ -286,7 +279,6 @@ else
case 'L' : // List all comments...
case 'l' : // List unapproved comments...
html_header("Comments");
- print("Comments \n");
if ($LOGIN_LEVEL < AUTH_DEVEL)
{
@@ -299,13 +291,13 @@ else
{
$result = db_query("SELECT * FROM comment WHERE "
."url LIKE '${listpath}%' ORDER BY id");
- print("[ Show Hidden Comments ]
\n");
+ print("Show Hidden Comments
\n");
}
else
{
$result = db_query("SELECT * FROM comment WHERE status = 0 AND "
."url LIKE '${listpath}%' ORDER BY id");
- print("[ Show All Comments ]
\n");
+ print("Show All Comments
\n");
}
}
@@ -329,9 +321,9 @@ else
print("$row[url] "
." by $create_user on $create_date "
- ."[ Edit "
- ."| Delete "
- ."]$contents \n");
+ ."Edit "
+ ."· Delete "
+ ."$contents \n");
}
print("\n");
diff --git a/www/docfiles/Abbreviations.html b/www/docfiles/Abbreviations.html
deleted file mode 100644
index 150fae8..0000000
--- a/www/docfiles/Abbreviations.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-The following abbreviations are used throughout this manual:
-
-Gb
-Gigabytes, or 1073741824 bytes
-
-
-kb
-Kilobytes, or 1024 bytes
-
-
-Mb
-Megabytes, or 1048576 bytes
-
-
-UTF-8, UTF-16
-Unicode Transformation Format, 8-bit or 16-bit
-
-
-W3C
-World Wide Web Consortium
-
-
-XML
-Extensible Markup Language
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/BuildingInstallingandPackagingMiniXML.html b/www/docfiles/BuildingInstallingandPackagingMiniXML.html
deleted file mode 100644
index 411c034..0000000
--- a/www/docfiles/BuildingInstallingandPackagingMiniXML.html
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
- Building, Installing, and
- Packaging Mini-XML
-This chapter describes how to build, install, and package Mini-XML on
- your system from the source archive. You will need an ANSI/ISO-C
- compatible compiler to build Mini-XML - GCC works, as do most vendors'
- C compilers. If you are building Mini-XML on Windows, we recommend
- using the Visual C++ environment with the supplied solution file. For
- other operating systems, you'll need a POSIX-compatible shell and
-make program in addition to the C compiler.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/ChangingNodeValues.html b/www/docfiles/ChangingNodeValues.html
deleted file mode 100644
index 3b12574..0000000
--- a/www/docfiles/ChangingNodeValues.html
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-All of the examples so far have concentrated on creating and loading
- new XML data nodes. Many applications, however, need to manipulate or
- change the nodes during their operation, so Mini-XML provides functions
- to change node values safely and without leaking memory.
-Existing nodes can be changed using the
-mxmlSetElement() ,
-mxmlSetInteger() ,
-mxmlSetOpaque() ,
-mxmlSetReal() ,
-mxmlSetText() , and
-mxmlSetTextf() functions. For example, use the following
- function call to change a text node to contain the text "new" with
- leading whitespace:
-
- mxml_node_t *node;
-
- mxmlSetText(node, 1, "new");
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CommentingYourCode.html b/www/docfiles/CommentingYourCode.html
deleted file mode 100644
index efec211..0000000
--- a/www/docfiles/CommentingYourCode.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-As noted previously, mxmldoc looks for in-line comments to
- describe the functions, types, and constants in your code. Mxmldoc
- will document all public names it finds in your source files - any
- names starting with the underscore character (_) or names that are
- documented with the @private@ directive are
- treated as private and are undocumented.
-Comments appearing directly before a function or type definition are
- used to document that function or type. Comments appearing after
- argument, definition, return type, or variable declarations are used to
- document that argument, definition, return type, or variable. For
- example, the following code excerpt defines a key/value structure and a
- function that creates a new instance of that structure:
-
- /* A key/value pair. This is used with the
- dictionary structure. */
-
- struct keyval
- {
- char *key; /* Key string */
- char *val; /* Value string */
- };
-
- /* Create a new key/value pair. */
-
- struct keyval * /* New key/value pair */
- new_keyval(
- const char *key, /* Key string */
- const char *val) /* Value string */
- {
- ...
- }
-
-Mxmldoc also knows to remove extra asterisks (*) from the
- comment string, so the comment string:
-
- /*
- * Compute the value of PI.
- *
- * The function connects to an Internet server
- * that streams audio of mathematical monks
- * chanting the first 100 digits of PI.
- */
-
-will be shown as:
-
- Compute the value of PI.
-
- The function connects to an Internet server
- that streams audio of mathematical monks
- chanting the first 100 digits of PI.
-
-Comments can also include the following
- special @name ...@ directive strings:
-
-@deprecated@ - flags the item as deprecated to discourage
- its use
-@private@ - flags the item as private so it will not be
- included in the documentation
-@since ...@ - flags the item as new since a particular
- release. The text following the @since up to the closing @
- is highlighted in the generated documentation, e.g. @since CUPS
- 1.3@ .
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CompilingMiniXML.html b/www/docfiles/CompilingMiniXML.html
deleted file mode 100644
index 1ffa51f..0000000
--- a/www/docfiles/CompilingMiniXML.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Mini-XML comes with both an autoconf-based configure script and a
- Visual C++ solution that can be used to compile the library and
- associated tools.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CompilingwithCommandLineTools.html b/www/docfiles/CompilingwithCommandLineTools.html
deleted file mode 100644
index a087e3a..0000000
--- a/www/docfiles/CompilingwithCommandLineTools.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Type the following command to configure the Mini-XML source code for
- your system:
-
- ./configure ENTER
-
-The default install prefix is /usr/local , which can be
- overridden using the --prefix option:
-
- ./configure --prefix=/foo ENTER
-
-Other configure options can be found using the --help
- option:
-
- ./configure --help ENTER
-
-Once you have configured the software, use the make(1)
- program to do the build and run the test program to verify that things
- are working, as follows:
-
- make ENTER
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CompilingwithVisualC.html b/www/docfiles/CompilingwithVisualC.html
deleted file mode 100644
index 15fbfdb..0000000
--- a/www/docfiles/CompilingwithVisualC.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Open the mxml.sln solution in the vcnet folder.
- Choose the desired build configuration, "Debug" (the default) or
- "Release", and then choose Build Solution from the
- Build menu.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Contents.html b/www/docfiles/Contents.html
deleted file mode 100644
index 50c2cb1..0000000
--- a/www/docfiles/Contents.html
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/ControllingLineWrapping.html b/www/docfiles/ControllingLineWrapping.html
deleted file mode 100644
index 9b078ac..0000000
--- a/www/docfiles/ControllingLineWrapping.html
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-When saving XML documents, Mini-XML normally wraps output lines at
- column 75 so that the text is readable in terminal windows. The
-mxmlSetWrapMargin function overrides the default wrap
- margin:
-
- /* Set the margin to 132 columns */
- mxmlSetWrapMargin(132);
-
- /* Disable wrapping */
- mxmlSetWrapMargin(0);
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CreatingMiniXMLPackages.html b/www/docfiles/CreatingMiniXMLPackages.html
deleted file mode 100644
index 283fe93..0000000
--- a/www/docfiles/CreatingMiniXMLPackages.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Mini-XML includes two files that can be used to create binary
- packages. The first file is mxml.spec which is used by the
-rpmbuild(8) software to create Red Hat Package Manager ("RPM")
- packages which are commonly used on Linux. Since rpmbuild
- wants to compile the software on its own, you can provide it with the
- Mini-XML tar file to build the package:
-
- rpmbuild -ta mxml-version .tar.gz ENTER
-
-The second file is mxml.list which is used by the
-epm(1) program to create software packages in a variety of formats.
- The epm program is available from the following URL:
-
- http://www.easysw.com/epm/
-
-Use the make command with the epm target to
- create portable and native packages for your system:
-
- make epm ENTER
-
-The packages are stored in a subdirectory named dist for
- your convenience. The portable packages utilize scripts and tar files
- to install the software on the target system. After extracting the
- package archive, use the mxml.install script to install the
- software.
-The native packages will be in the local OS's native format: RPM for
- Red Hat Linux, DPKG for Debian Linux, PKG for Solaris, and so forth.
- Use the corresponding commands to install the native packages.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CreatingXMLDocuments.html b/www/docfiles/CreatingXMLDocuments.html
deleted file mode 100644
index 0581b9c..0000000
--- a/www/docfiles/CreatingXMLDocuments.html
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-You can create and update XML documents in memory using the various
-mxmlNew functions. The following code will create the XML document
- described in the previous section:
-
- mxml_node_t *xml; /* <?xml ... ?> */
- mxml_node_t *data; /* <data> */
- mxml_node_t *node; /* <node> */
- mxml_node_t *group; /* <group> */
-
- xml = mxmlNewXML("1.0");
-
- data = mxmlNewElement(xml, "data");
-
- node = mxmlNewElement(data, "node");
- mxmlNewText(node, 0, "val1");
- node = mxmlNewElement(data, "node");
- mxmlNewText(node, 0, "val2");
- node = mxmlNewElement(data, "node");
- mxmlNewText(node, 0, "val3");
-
- group = mxmlNewElement(data, "group");
-
- node = mxmlNewElement(group, "node");
- mxmlNewText(node, 0, "val4");
- node = mxmlNewElement(group, "node");
- mxmlNewText(node, 0, "val5");
- node = mxmlNewElement(group, "node");
- mxmlNewText(node, 0, "val6");
-
- node = mxmlNewElement(data, "node");
- mxmlNewText(node, 0, "val7");
- node = mxmlNewElement(data, "node");
- mxmlNewText(node, 0, "val8");
-
-We start by creating the <?xml version="1.0"?> node common
- to all XML files using the
-mxmlNewXML function:
-
- xml = mxmlNewXML("1.0");
-
-We then create the <data> node used for this document using
- the mxmlNewElement
- function. The first argument specifies the parent node (xml
-) while the second specifies the element name (data ):
-
- data = mxmlNewElement(xml, "data");
-
-Each <node>...</node> in the file is created using the
-mxmlNewElement and
-mxmlNewText functions. The first argument of mxmlNewText
- specifies the parent node (node ). The second argument
- specifies whether whitespace appears before the text - 0 or false in
- this case. The last argument specifies the actual text to add:
-
- node = mxmlNewElement(data, "node");
- mxmlNewText(node, 0, "val1");
-
-The resulting in-memory XML document can then be saved or processed
- just like one loaded from disk or a string.
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/CustomDataTypes.html b/www/docfiles/CustomDataTypes.html
deleted file mode 100644
index a78dd51..0000000
--- a/www/docfiles/CustomDataTypes.html
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Mini-XML supports custom data types via global load and save
- callbacks. Only a single set of callbacks can be active at any time,
- 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 load callback receives a pointer to the current data node and a
- string of opaque character data from the XML source with character
- entities converted to the corresponding UTF-8 characters. For example,
- if we wanted to support a custom date/time type whose value is encoded
- as "yyyy-mm-ddThh:mm:ssZ" (ISO format), the load callback would look
- like the following:
-
- typedef struct
- {
- unsigned year, /* Year */
- month, /* Month */
- day, /* Day */
- hour, /* Hour */
- minute, /* Minute */
- second; /* Second */
- time_t unix; /* UNIX time */
- } iso_date_time_t;
-
- int
- load_custom(mxml_node_t *node,
- const char *data)
- {
- iso_date_time_t *dt;
- struct tm tmdata;
-
- /*
- * Allocate data structure...
- */
-
- dt = calloc(1, sizeof(iso_date_time_t));
-
- /*
- * Try reading 6 unsigned integers from the
- * data string...
- */
-
- if (sscanf(data, "%u-%u-%uT%u:%u:%uZ",
- &(dt->year), &(dt->month),
- &(dt->day), &(dt->hour),
- &(dt->minute),
- &(dt->second)) != 6)
- {
- /*
- * Unable to read numbers, free the data
- * structure and return an error...
- */
-
- free(dt);
-
- return (-1);
- }
-
- /*
- * Range check values...
- */
-
- if (dt->month <1 || dt->month > 12 ||
- dt->day <1 || dt->day > 31 ||
- dt->hour <0 || dt->hour > 23 ||
- dt->minute <0 || dt->minute > 59 ||
- dt->second <0 || dt->second > 59)
- {
- /*
- * Date information is out of range...
- */
-
- free(dt);
-
- return (-1);
- }
-
- /*
- * Convert ISO time to UNIX time in
- * seconds...
- */
-
- tmdata.tm_year = dt->year - 1900;
- tmdata.tm_mon = dt->month - 1;
- tmdata.tm_day = dt->day;
- tmdata.tm_hour = dt->hour;
- tmdata.tm_min = dt->minute;
- tmdata.tm_sec = dt->second;
-
- dt->unix = gmtime(&tmdata);
-
- /*
- * Assign custom node data and destroy
- * function pointers...
- */
-
- node->value.custom.data = dt;
- node->value.custom.destroy = free;
-
- /*
- * Return with no errors...
- */
-
- return (0);
- }
-
-The function itself can return 0 on success or -1 if it is unable to
- decode the custom data or the data contains an error. Custom data nodes
- contain a void pointer to the allocated custom data for the
- node and a pointer to a destructor function which will free the custom
- data when the node is deleted.
-The save callback receives the node pointer and returns an allocated
- string containing the custom data value. The following save callback
- could be used for our ISO date/time type:
-
- char *
- save_custom(mxml_node_t *node)
- {
- char data[255];
- iso_date_time_t *dt;
-
-
- dt = (iso_date_time_t *)node->custom.data;
-
- snprintf(data, sizeof(data),
- "%04u-%02u-%02uT%02u:%02u:%02uZ",
- dt->year, dt->month, dt->day,
- dt->hour, dt->minute, dt->second);
-
- return (strdup(data));
- }
-
-You register the callback functions using the
-mxmlSetCustomHandlers() function:
-
- mxmlSetCustomHandlers(load_custom ,
- save_custom );
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Enumerations.html b/www/docfiles/Enumerations.html
deleted file mode 100644
index f3573c3..0000000
--- a/www/docfiles/Enumerations.html
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/FindingandIteratingNodes.html b/www/docfiles/FindingandIteratingNodes.html
deleted file mode 100644
index 0469e00..0000000
--- a/www/docfiles/FindingandIteratingNodes.html
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-The mxmlWalkPrev
- and mxmlWalkNext
-functions can be used to iterate through the XML node tree:
-
- mxml_node_t *node;
-
- node = mxmlWalkPrev(current, tree,
- MXML_DESCEND);
-
- node = mxmlWalkNext(current, tree,
- MXML_DESCEND);
-
-In addition, you can find a named element/node using the
-mxmlFindElement function:
-
- mxml_node_t *node;
-
- node = mxmlFindElement(tree, tree, "name",
- "attr", "value",
- MXML_DESCEND);
-
-The name , attr , and value arguments can be
- passed as NULL to act as wildcards, e.g.:
-
-
-
- /* Find the first "a" element */
- node = mxmlFindElement(tree, tree, "a",
- NULL, NULL,
- MXML_DESCEND);
-
-
-
-
- /* Find the first "a" element with "href"
- attribute */
- node = mxmlFindElement(tree, tree, "a",
- "href", NULL,
- MXML_DESCEND);
-
-
-
-
- /* Find the first "a" element with "href"
- to a URL */
- node = mxmlFindElement(tree, tree, "a",
- "href",
- "http://www.easysw.com/",
- MXML_DESCEND);
-
-
-
-
- /* Find the first element with a "src"
- attribute */
- node = mxmlFindElement(tree, tree, NULL,
- "src", NULL,
- MXML_DESCEND);
-
-
-
-
- /* Find the first element with a "src"
- = "foo.jpg" */
- node = mxmlFindElement(tree, tree, NULL,
- "src", "foo.jpg",
- MXML_DESCEND);
-
-You can also iterate with the same function:
-
- mxml_node_t *node;
-
- for (node = mxmlFindElement(tree, tree,
- "name",
- NULL, NULL,
- MXML_DESCEND);
- node != NULL;
- node = mxmlFindElement(node, tree,
- "name",
- NULL, NULL,
- MXML_DESCEND))
- {
- ... do something ...
- }
-
-
-
-The MXML_DESCEND argument can actually be one of three
- constants:
-
-MXML_NO_DESCEND means to not to look at any child nodes in
- the element hierarchy, just look at siblings at the same level or
- parent nodes until the top node or top-of-tree is reached.
-The previous node from "group" would be the "node" element to the
- left, while the next node from "group" would be the "node" element to
- the right.
-
-
-
-MXML_DESCEND_FIRST means that it is OK to descend to the
- first child of a node, but not to descend further when searching.
- You'll normally use this when iterating through direct children of a
- parent node, e.g. all of the "node" and "group" elements under the
- "?xml" parent node in the example above.
-This mode is only applicable to the search function; the walk
- functions treat this as MXML_DESCEND since every call is a
- first time.
-
-
-
-MXML_DESCEND means to keep descending until you hit the
- bottom of the tree. The previous node from "group" would be the "val3"
- node and the next node would be the first node element under "group".
-If you were to walk from the root node "?xml" to the end of the tree
- with mxmlWalkNext() , the order would be:
-?xml data node val1 node val2 node val3 group node val4 node val5
- node val6 node val7 node val8
-If you started at "val8" and walked using mxmlWalkPrev() ,
- the order would be reversed, ending at "?xml".
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/FormattedText.html b/www/docfiles/FormattedText.html
deleted file mode 100644
index 84ead98..0000000
--- a/www/docfiles/FormattedText.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-The mxmlNewTextf()
- and mxmlSetTextf()
- functions create and change text nodes, respectively, using printf
--style format strings and arguments. For example, use the following
- function call to create a new text node containing a constructed
- filename:
-
- mxml_node_t *node;
-
- node = mxmlNewTextf(node, 1, "%s/%s",
- path, filename);
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Functions.html b/www/docfiles/Functions.html
deleted file mode 100644
index 601b836..0000000
--- a/www/docfiles/Functions.html
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/GettingStartedwithMiniXML.html b/www/docfiles/GettingStartedwithMiniXML.html
deleted file mode 100644
index 7bb31d5..0000000
--- a/www/docfiles/GettingStartedwithMiniXML.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
- Getting Started with Mini-XML
-This chapter describes how to write programs that use Mini-XML to
- access data in an XML file. Mini-XML provides the following
- functionality:
-
-Functions for creating and managing XML documents in memory.
-Reading of UTF-8 and UTF-16 encoded XML files and strings.
-Writing of UTF-8 encoded XML files and strings.
-Support for arbitrary element names, attributes, and attribute
- values with no preset limits, just available memory.
-Support for integer, real, opaque ("cdata"), and text data types in
- "leaf" nodes.
-"Find", "index", and "walk" functions for easily accessing data in
- an XML document.
-
-Mini-XML doesn't do validation or other types of processing on the
- data based upon schema files or other sources of definition
- information, nor does it support character entities other than those
- required by the XML specification.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Indexing.html b/www/docfiles/Indexing.html
deleted file mode 100644
index 75556e9..0000000
--- a/www/docfiles/Indexing.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Mini-XML provides functions for managing indices of nodes. The
- current implementation provides the same functionality as
-mxmlFindElement() . The advantage of using an index is that
- searching and enumeration of elements is significantly faster. The only
- disadvantage is that each index is a static snapshot of the XML
- document, so indices are not well suited to XML data that is updated
- more often than it is searched. The overhead of creating an index is
- approximately equal to walking the XML document tree. Nodes in the
- index are sorted by element name and attribute value.
-Indices are stored in
-mxml_index_t structures. The
-mxmlIndexNew() function creates a new index:
-
- mxml_node_t *tree;
- mxml_index_t *ind;
-
- ind = mxmlIndexNew(tree, "element",
- "attribute");
-
-The first argument is the XML node tree to index. Normally this will
- be a pointer to the ?xml element.
-The second argument contains the element to index; passing NULL
- indexes all element nodes alphabetically.
-The third argument contains the attribute to index; passing NULL
- causes only the element name to be indexed.
-Once the index is created, the
-mxmlIndexEnum() ,
-mxmlIndexFind() , and
-mxmlIndexReset() functions are used to access the nodes in
- the index. The
-mxmlIndexReset() function resets the "current" node pointer in
- the index, allowing you to do new searches and enumerations on the same
- index. Typically you will call this function prior to your calls to
-mxmlIndexEnum() and
-mxmlIndexFind() .
-The mxmlIndexEnum()
- function enumerates each of the nodes in the index and can be used
- in a loop as follows:
-
- mxml_node_t *node;
-
- mxmlIndexReset(ind);
-
- while ((node = mxmlIndexEnum(ind)) != NULL)
- {
- // do something with node
- }
-
-The mxmlIndexFind()
- function locates the next occurrence of the named element and
- attribute value in the index. It can be used to find all matching
- elements in an index, as follows:
-
- mxml_node_t *node;
-
- mxmlIndexReset(ind);
-
- while ((node = mxmlIndexFind(ind, "element",
- "attr-value"))
- != NULL)
- {
- // do something with node
- }
-
-The second and third arguments represent the element name and
- attribute value, respectively. A NULL pointer is used to
- return all elements or attributes in the index. Passing NULL
- for both the element name and attribute value is equivalent to calling
-mxmlIndexEnum .
-When you are done using the index, delete it using the
-mxmlIndexDelete() function:
-
- mxmlIndexDelete(ind);
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/InstallingMiniXML.html b/www/docfiles/InstallingMiniXML.html
deleted file mode 100644
index 0accd59..0000000
--- a/www/docfiles/InstallingMiniXML.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-If you are using Visual C++, copy the mxml.lib and and
- mxml.h files to the Visual C++ lib and include
- directories, respectively.
-Otherwise, use the make command with the install
- target to install Mini-XML in the configured directories:
-
- make install ENTER
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Introduction.html b/www/docfiles/Introduction.html
deleted file mode 100644
index ef1308f..0000000
--- a/www/docfiles/Introduction.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-Contents
-Next
-
- Introduction
-This programmers manual describes Mini-XML version 2.3, a small XML
- parsing library that you can use to read and write XML data files in
- your C and C++ applications.
-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.
-I then replied with:
-Given the limited scope of what you use in XML, it
- should be trivial to code a mini-XML API in a few hundred lines of
- code.
-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 3,441 lines of code,
- compared to 103,893 lines of code for libxml2 version 2.6.9.
-Aside from Gutenprint, Mini-XML is used for the following
- projects/software applications:
-
-Please email me (mxml @ easysw . com) if you would like your project
- added or removed from this list, or if you have any comments/quotes you
- would like me to publish about your experiences with Mini-XML.
-
-Contents
-Next
-
-
diff --git a/www/docfiles/LegalStuff.html b/www/docfiles/LegalStuff.html
deleted file mode 100644
index b6f7e01..0000000
--- a/www/docfiles/LegalStuff.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-The Mini-XML library is copyright 2003-2007 by Michael Sweet.
-This library is free software; you can redistribute it and/or modify
- it under the terms of the GNU
- Library General Public License as published by the Free Software
- Foundation; either version 2 of the License, or (at your option) any
- later version.
-This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/LibraryReference.html b/www/docfiles/LibraryReference.html
deleted file mode 100644
index be5ab54..0000000
--- a/www/docfiles/LibraryReference.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
- Library Reference
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/LoadCallbacks.html b/www/docfiles/LoadCallbacks.html
deleted file mode 100644
index a04b704..0000000
--- a/www/docfiles/LoadCallbacks.html
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Chapter 2 introduced the
-mxmlLoadFile() and
-mxmlLoadString() functions. The last argument to these
- 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:
-
-MXML_INTEGER_CALLBACK - All data nodes contain
- whitespace-separated integers.
-MXML_OPAQUE_CALLBACK - All data nodes contain opaque
- strings ("CDATA").
-MXML_REAL_CALLBACK - All data nodes contain
- whitespace-separated floating-point numbers.
-MXML_TEXT_CALLBACK - All data nodes contain
- whitespace-separated strings.
-
-You can provide your own callback functions for more complex XML
- documents. Your callback function will receive a pointer to the current
- element node and must return the value type of the immediate children
- for that element node: MXML_INTEGER , MXML_OPAQUE ,
-MXML_REAL , or MXML_TEXT . The function is called after
- the element and its attributes have been read, so you can look at the
- element name, attributes, and attribute values to determine the proper
- value type to return.
-
-
-The following callback function looks for an attribute named "type"
- or the element name to determine the value type for its child nodes:
-
- mxml_type_t
- type_cb(mxml_node_t *node)
- {
- const char *type;
-
- /*
- * You can lookup attributes and/or use the
- * element name, hierarchy, etc...
- */
-
- type = mxmlElementGetAttr(node, "type");
- if (type == NULL)
- type = node->value.element.name;
-
- if (!strcmp(type, "integer"))
- return (MXML_INTEGER);
- else if (!strcmp(type, "opaque"))
- return (MXML_OPAQUE);
- else if (!strcmp(type, "real"))
- return (MXML_REAL);
- else
- return (MXML_TEXT);
- }
-
-To use this callback function, simply use the name when you call any
- of the load functions:
-
- FILE *fp;
- mxml_node_t *tree;
-
- fp = fopen("filename.xml", "r");
- tree = mxmlLoadFile(NULL, fp, type_cb );
- fclose(fp);
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/LoadingXML.html b/www/docfiles/LoadingXML.html
deleted file mode 100644
index 4369db8..0000000
--- a/www/docfiles/LoadingXML.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-You load an XML file using the
-mxmlLoadFile function:
-
- FILE *fp;
- mxml_node_t *tree;
-
- fp = fopen("filename.xml", "r");
- tree = mxmlLoadFile(NULL, fp,
- MXML_TEXT_CALLBACK);
- fclose(fp);
-
-The first argument specifies an existing XML parent node, if any.
- Normally you will pass NULL for this argument unless you are
- combining multiple XML sources. The XML file must contain a complete
- XML document including the ?xml element if the parent node is
-NULL .
-The second argument specifies the stdio file to read from, as opened
- by fopen() or popen() . You can also use stdin
- if you are implementing an XML filter program.
-The third argument specifies a callback function which returns the
- value type of the immediate children for a new element node:
-MXML_CUSTOM , MXML_IGNORE , MXML_INTEGER ,
-MXML_OPAQUE , MXML_REAL , or MXML_TEXT . Load
- callbacks are described in detail in
-Chapter 3 . The example code uses the MXML_TEXT_CALLBACK
- constant which specifies that all data nodes in the document contain
- whitespace-separated text values. Other standard callbacks include
-MXML_IGNORE_CALLBACK , MXML_INTEGER_CALLBACK ,
-MXML_OPAQUE_CALLBACK , and MXML_REAL_CALLBACK .
-The mxmlLoadString
- function loads XML node trees from a string:
-
-
-
- char buffer[8192];
- mxml_node_t *tree;
-
- ...
- tree = mxmlLoadString(NULL, buffer,
- MXML_TEXT_CALLBACK);
-
-The first and third arguments are the same as used for
-mxmlLoadFile() . The second argument specifies the string or
- character buffer to load and must be a complete XML document including
- the ?xml element if the parent node is NULL .
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML21mxmlNewCustom.html b/www/docfiles/MiniXML21mxmlNewCustom.html
deleted file mode 100644
index cb1d9fe..0000000
--- a/www/docfiles/MiniXML21mxmlNewCustom.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Create a new custom data node.
-The new custom node is added to the end of the specified parent's
- child list. The constant MXML_NO_PARENT can be used to specify that the
- new element node has no parent. NULL can be passed when the data in the
- node is not dynamically allocated or is separately managed.
-Syntax
- mxml_node_t *
- mxmlNewCustom( mxml_node_t
- * parent, void * data,
-mxml_custom_destroy_cb_t destroy);
-Arguments
-
-
-Name Description
-
-parent Parent node or MXML_NO_PARENT
-data Pointer to data
-destroy Function to destroy data
-
-
-Returns
-New node
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML21mxmlSetCustom.html b/www/docfiles/MiniXML21mxmlSetCustom.html
deleted file mode 100644
index 5506271..0000000
--- a/www/docfiles/MiniXML21mxmlSetCustom.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Set the data and destructor of a custom data node.
-The node is not changed if it is not a custom node.
-Syntax
- int
- mxmlSetCustom( mxml_node_t
- * node, void * data,
-mxml_custom_destroy_cb_t destroy);
-Arguments
-
-
-Name Description
-
-node Node to set
-data New data pointer
-destroy New destructor function
-
-
-Returns
-0 on success, -1 on failure
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML21mxmlcustoms.html b/www/docfiles/MiniXML21mxmlcustoms.html
deleted file mode 100644
index ca9ae0b..0000000
--- a/www/docfiles/MiniXML21mxmlcustoms.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-An XML custom value.
-Definition
- struct mxml_custom_s
- {
- void * data;
-
-mxml_custom_destroy_cb_t destroy;
- };
-Members
-
-
-Name Description
-
-data Pointer to (allocated) custom data
-destroy Pointer to destructor function
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML21mxmlcustomt.html b/www/docfiles/MiniXML21mxmlcustomt.html
deleted file mode 100644
index 2353184..0000000
--- a/www/docfiles/MiniXML21mxmlcustomt.html
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-An XML custom value.
-Definition
- typedef struct
-mxml_custom_s mxml_custom_t;
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlElementSetAttrf.html b/www/docfiles/MiniXML23mxmlElementSetAttrf.html
deleted file mode 100644
index d7b9108..0000000
--- a/www/docfiles/MiniXML23mxmlElementSetAttrf.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Set an attribute with a formatted value.
-If the named attribute already exists, the value of the attribute is
- replaced by the new formatted string. The formatted string value is
- copied into the element node. This function does nothing if the node is
- not an element.
-Syntax
- void
- mxmlElementSetAttrf(
-mxml_node_t * node, const char * name, const char * format, ...);
-
-Arguments
-
-
-Name Description
-
-node Element node
-name Name of attribute
-format Printf-style attribute value
-... Additional arguments as needed
-
-
-Returns
-Nothing.
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlNewCDATA.html b/www/docfiles/MiniXML23mxmlNewCDATA.html
deleted file mode 100644
index 0b2e1c6..0000000
--- a/www/docfiles/MiniXML23mxmlNewCDATA.html
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Create a new CDATA node.
-The new CDATA node is added to the end of the specified parent's
- child list. The constant MXML_NO_PARENT can be used to specify that the
- new CDATA node has no parent. The data string must be nul-terminated
- and is copied into the new node. CDATA nodes use the MXML_ELEMENT type.
-Syntax
- mxml_node_t *
- mxmlNewCDATA( mxml_node_t
- * parent, const char * data);
-Arguments
-
-
-Name Description
-
-parent Parent node or MXML_NO_PARENT
-data Data string
-
-
-Returns
-New node
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlNewXML.html b/www/docfiles/MiniXML23mxmlNewXML.html
deleted file mode 100644
index 87fc009..0000000
--- a/www/docfiles/MiniXML23mxmlNewXML.html
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Create a new XML document tree.
-The "version" argument specifies the version number to put in the
- ?xml element node. If NULL, version 1.0 is assumed.
-Syntax
- mxml_node_t *
- mxmlNewXML( const char * version);
-Arguments
-
-
-Name Description
-
-version Version number to use
-
-
-Returns
-New ?xml node
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlRelease.html b/www/docfiles/MiniXML23mxmlRelease.html
deleted file mode 100644
index 5ab360c..0000000
--- a/www/docfiles/MiniXML23mxmlRelease.html
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Release a node.
-When the reference count reaches zero, the node (and any children) is
- deleted via mxmlDelete().
-Syntax
- int
- mxmlRelease( mxml_node_t *
- node);
-Arguments
-
-
-Name Description
-
-node Node
-
-
-Returns
-New reference count
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlRetain.html b/www/docfiles/MiniXML23mxmlRetain.html
deleted file mode 100644
index 7b4069c..0000000
--- a/www/docfiles/MiniXML23mxmlRetain.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Retain a node.
-Syntax
- int
- mxmlRetain( mxml_node_t *
- node);
-Arguments
-
-
-Name Description
-
-node Node
-
-
-Returns
-New reference count
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlSAXLoadFd.html b/www/docfiles/MiniXML23mxmlSAXLoadFd.html
deleted file mode 100644
index 6f62267..0000000
--- a/www/docfiles/MiniXML23mxmlSAXLoadFd.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Load a file descriptor into an XML node tree using a SAX callback.
-The nodes in the specified file are added to the specified top node.
- If no top node is provided, the XML file MUST be well-formed with a
- single parent node like <?xml> for the entire file. The callback
- function returns the value type that should be used for child nodes. If
- MXML_NO_CALLBACK is specified then all child nodes will be either
- MXML_ELEMENT or MXML_TEXT nodes.
-The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
-The SAX callback must call mxmlRetain() for any nodes that need to be
- kept for later use. Otherwise, nodes are deleted when the parent node
- is closed or after each data, comment, CDATA, or directive node.
-Syntax
- mxml_node_t *
- mxmlSAXLoadFd( mxml_node_t
- * top, int fd, mxml_load_cb_t
- cb, mxml_sax_cb_t sax_cb,
- void * sax_data);
-Arguments
-
-
-Name Description
-
-top Top node
-fd File descriptor to read from
-cb Callback function or MXML_NO_CALLBACK
-sax_cb SAX callback or MXML_NO_CALLBACK
-sax_data SAX user data
-
-
-Returns
-First node or NULL if the file could not be read.
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlSAXLoadFile.html b/www/docfiles/MiniXML23mxmlSAXLoadFile.html
deleted file mode 100644
index dfd7c9e..0000000
--- a/www/docfiles/MiniXML23mxmlSAXLoadFile.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Load a file into an XML node tree using a SAX callback.
-The nodes in the specified file are added to the specified top node.
- If no top node is provided, the XML file MUST be well-formed with a
- single parent node like <?xml> for the entire file. The callback
- function returns the value type that should be used for child nodes. If
- MXML_NO_CALLBACK is specified then all child nodes will be either
- MXML_ELEMENT or MXML_TEXT nodes.
-The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
-The SAX callback must call mxmlRetain() for any nodes that need to be
- kept for later use. Otherwise, nodes are deleted when the parent node
- is closed or after each data, comment, CDATA, or directive node.
-Syntax
- mxml_node_t *
- mxmlSAXLoadFile( mxml_node_t
- * top, FILE * fp,
-mxml_load_cb_t cb,
-mxml_sax_cb_t sax_cb, void * sax_data);
-Arguments
-
-
-Name Description
-
-top Top node
-fp File to read from
-cb Callback function or MXML_NO_CALLBACK
-sax_cb SAX callback or MXML_NO_CALLBACK
-sax_data SAX user data
-
-
-Returns
-First node or NULL if the file could not be read.
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlSAXLoadString.html b/www/docfiles/MiniXML23mxmlSAXLoadString.html
deleted file mode 100644
index 0ff9018..0000000
--- a/www/docfiles/MiniXML23mxmlSAXLoadString.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Load a string into an XML node tree using a SAX callback.
-The nodes in the specified string are added to the specified top
- node. If no top node is provided, the XML string MUST be well-formed
- with a single parent node like <?xml> for the entire string. The
- callback function returns the value type that should be used for child
- nodes. If MXML_NO_CALLBACK is specified then all child nodes will be
- either MXML_ELEMENT or MXML_TEXT nodes.
-The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
- MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
- child nodes of the specified type.
-The SAX callback must call mxmlRetain() for any nodes that need to be
- kept for later use. Otherwise, nodes are deleted when the parent node
- is closed or after each data, comment, CDATA, or directive node.
-Syntax
- 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);
-Arguments
-
-
-Name Description
-
-top Top node
-s String to load
-cb Callback function or MXML_NO_CALLBACK
-sax_cb SAX callback or MXML_NO_CALLBACK
-sax_data SAX user data
-
-
-Returns
-First node or NULL if the string has errors.
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlSetCDATA.html b/www/docfiles/MiniXML23mxmlSetCDATA.html
deleted file mode 100644
index f81a6bf..0000000
--- a/www/docfiles/MiniXML23mxmlSetCDATA.html
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Set the element name of a CDATA node.
-The node is not changed if it is not a CDATA element node.
-Syntax
- int
- mxmlSetCDATA( mxml_node_t
- * node, const char * data);
-Arguments
-
-
-Name Description
-
-node Node to set
-data New data string
-
-
-Returns
-0 on success, -1 on failure
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MiniXML23mxmlSetWrapMargin.html b/www/docfiles/MiniXML23mxmlSetWrapMargin.html
deleted file mode 100644
index 01a6ac5..0000000
--- a/www/docfiles/MiniXML23mxmlSetWrapMargin.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Description
-Set the the wrap margin when saving XML data.
-Wrapping is disabled when "column" is <= 0.
-Syntax
- void
- mxmlSetWrapMargin( int column);
-Arguments
-
-
-Name Description
-
-column Column for wrapping
-
-
-Returns
-Nothing.
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/MoreMiniXMLProgrammingTechniques.html b/www/docfiles/MoreMiniXMLProgrammingTechniques.html
deleted file mode 100644
index 94d72d2..0000000
--- a/www/docfiles/MoreMiniXMLProgrammingTechniques.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
- More Mini-XML Programming
- Techniques
-This chapter shows additional ways to use the Mini-XML library in
- your programs.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Nodes.html b/www/docfiles/Nodes.html
deleted file mode 100644
index 1456a67..0000000
--- a/www/docfiles/Nodes.html
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Every piece of information in an XML file (elements, text, numbers)
- is stored in memory in "nodes". 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.
-
-
-
- Table 2-1: Mini-XML Node Value
- Members
-Value Type Node member
-Custom void *
-node->value.custom.data
-Element char *
-node->value.element.name
-Integer int node->value.integer
-
-Opaque (string) char *
-node->value.opaque
-Real double node->value.real
-
-Text char * node->value.text.string
-
-
-
-Each node also has a user_data member which allows you to
- associate application-specific data with each node as needed.
-New nodes are created using the
-mxmlNewElement ,
-mxmlNewInteger ,
-mxmlNewOpaque ,
-mxmlNewReal ,
-mxmlNewText
-mxmlNewTextf
-mxmlNewXML functions. Only elements can have child nodes, and
- the top node must be an element, usually the <?xml version="1.0"?>
- node created by mxmlNewXML() .
-Nodes have pointers to the node above (parent ), below (
-child ), left (prev ), and right (next ) of the
- current node. If you have an XML file like the following:
-
- <?xml version="1.0"?>
- <data>
- <node>val1</node>
- <node>val2</node>
- <node>val3</node>
- <group>
- <node>val4</node>
- <node>val5</node>
- <node>val6</node>
- </group>
- <node>val7</node>
- <node>val8</node>
- </data>
-
-the node tree for the file would look like the following in memory:
-
- ?xml
- |
- data
- |
- node - node - node - group - node - node
- | | | | | |
- val1 val2 val3 | val7 val8
- |
- node - node - node
- | | |
- val4 val5 val6
-
-where "-" is a pointer to the next node and "|" is a pointer to the
- first child node.
-Once you are done with the XML data, use the
-mxmlDelete function to recursively free the memory that is
- used for a particular node or the entire tree:
-
- mxmlDelete(tree);
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/NotationConventions.html b/www/docfiles/NotationConventions.html
deleted file mode 100644
index 3cf4f34..0000000
--- a/www/docfiles/NotationConventions.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Various font and syntax conventions are used in this guide. Examples
- and their meanings and uses are explained below:
-
-lpstat
- lpstat(1)
-The names of commands; the first mention of a command or function in
- a chapter is followed by a manual page section number.
-
-
-/var
- /usr/share/cups/data/testprint.ps
-File and directory names.
-
-
-Request ID is Printer-123
-Screen output.
-
-
-lp -d printer filename ENTER
-Literal user input; special keys like ENTER are in ALL
- CAPS.
-
-
-12.3
-Numbers in the text are written using the period (.) to indicate the
- decimal point.
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/OrganizationofThisDocument.html b/www/docfiles/OrganizationofThisDocument.html
deleted file mode 100644
index fa89726..0000000
--- a/www/docfiles/OrganizationofThisDocument.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-This manual is organized into the following chapters and appendices:
-
-Chapter 1, "
-Building, Installing, and Packaging Mini-XML ", provides compilation,
- installation, and packaging instructions for Mini-XML.
-Chapter 2, "Getting
- Started with Mini-XML ", shows how to use the Mini-XML library in
- your programs.
-Chapter 3, "
-More Mini-XML Programming Techniques ", shows additional ways to use
- the Mini-XML library.
-Chapter 4, "Using the
- mxmldoc Utility ", describes how to use the mxmldoc(1)
- program to generate software documentation.
-Appendix A, "Mini-XML License
-", provides the terms and conditions for using and distributing
- Mini-XML.
-Appendix B, "Release Notes
-", lists the changes in each release of Mini-XML.
-Appendix C, "Library
- Reference ", contains a complete reference for Mini-XML, generated
- by mxmldoc .
-Appendix D, "XML Schema ", shows
- the XML schema used for the XML files produced by mxmldoc .
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/OtherReferences.html b/www/docfiles/OtherReferences.html
deleted file mode 100644
index e2c1143..0000000
--- a/www/docfiles/OtherReferences.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-The Unicode Standard, Version 4.0, Addison-Wesley, ISBN
- 0-321-18578-1
-The definition of the Unicode character set which is used for XML.
-
-
-Extensible
- Markup Language (XML) 1.0 (Third Edition)
-The XML specification from the World Wide Web Consortium (W3C)
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/SAXStreamLoadingofDocuments.html b/www/docfiles/SAXStreamLoadingofDocuments.html
deleted file mode 100644
index 5fb3ab1..0000000
--- a/www/docfiles/SAXStreamLoadingofDocuments.html
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-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.
- Each function works like the corresponding mxmlLoad function
- but uses a callback to process each node as it is read.
-The callback function receives the node, an event code, and a user
- data pointer you supply:
-
- void
- sax_cb(mxml_node_t *node,
- mxml_sax_event_t event,
- void *data)
- {
- ... do something ...
- }
-
-The event will be one of the following:
-
-MXML_SAX_CDATA - CDATA was just read
-MXML_SAX_COMMENT - A comment was just read
-MXML_SAX_DATA - Data (custom, integer, opaque, real, or
- text) was just read
-MXML_SAX_DIRECTIVE - A processing directive was just read
-MXML_SAX_ELEMENT_CLOSE - An open element was just read (
-<element> )
-MXML_SAX_ELEMENT_OPEN - A close element was just read (
-</element> )
-
-Elements are released after the close element is processed.
- All other nodes are released after they are processed. The SAX callback
- can retain the node using the
-mxmlRetain function. For example, the following SAX
- callback will retain all nodes, effectively simulating a normal
- in-memory load:
-
- void
- sax_cb(mxml_node_t *node,
- mxml_sax_event_t event,
- void *data)
- {
- if (event != MXML_SAX_ELEMENT_CLOSE)
- mxmlRetain(node);
- }
-
-More typically the SAX callback will only retain a small portion of
- the document that is needed for post-processing. For example, the
- following SAX callback will retain the title and headings in an XHTML
- file. It also retains the (parent) elements like <html> ,
-<head> , and <body> , and processing directives like
-<?xml ... ?> and <!DOCTYPE ... > :
-
-
-
- void
- sax_cb(mxml_node_t *node,
- mxml_sax_event_t event,
- void *data)
- {
- if (event == MXML_SAX_ELEMENT_OPEN)
- {
- /*
- * Retain headings and titles...
- */
-
- char *name = node->value.element.name;
-
- if (!strcmp(name, "html") ||
- !strcmp(name, "head") ||
- !strcmp(name, "title") ||
- !strcmp(name, "body") ||
- !strcmp(name, "h1") ||
- !strcmp(name, "h2") ||
- !strcmp(name, "h3") ||
- !strcmp(name, "h4") ||
- !strcmp(name, "h5") ||
- !strcmp(name, "h6"))
- mxmlRetain(node);
- }
- else if (event == MXML_SAX_DIRECTIVE)
- mxmlRetain(node);
- else if (event == MXML_SAX_DATA &&
- node->parent->ref_count > 1)
- {
- /*
- * If the parent was retained, then retain
- * this data node as well.
- */
-
- mxmlRetain(node);
- }
- }
-
-The resulting skeleton document tree can then be searched just like
- one loaded using the mxmlLoad functions. For example, a filter
- that reads an XHTML document from stdin and then shows the title and
- headings in the document would look like:
-
- mxml_node_t *doc, *title, *body, *heading;
-
- doc = mxmlSAXLoadFd(NULL, 0,
- MXML_TEXT_CALLBACK,
- sax_cb , NULL);
-
- title = mxmlFindElement(doc, doc, "title",
- NULL, NULL,
- MXML_DESCEND);
-
- if (title)
- print_children(title);
-
- body = mxmlFindElement(doc, doc, "body",
- NULL, NULL,
- MXML_DESCEND);
-
- if (body)
- {
- for (heading = body->child;
- heading;
- heading = heading->next)
- print_children(heading);
- }
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/SaveCallbacks.html b/www/docfiles/SaveCallbacks.html
deleted file mode 100644
index b13e041..0000000
--- a/www/docfiles/SaveCallbacks.html
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Chapter 2 also introduced the
-mxmlSaveFile() ,
-mxmlSaveString() , and
-mxmlSaveAllocString() functions. The last argument to these
- functions is a callback function which is used to automatically insert
- whitespace in an XML document.
-Your callback function will be called up to four times for each
- element node with a pointer to the node and a "where" value of
-MXML_WS_BEFORE_OPEN , MXML_WS_AFTER_OPEN ,
-MXML_WS_BEFORE_CLOSE , or MXML_WS_AFTER_CLOSE . The callback
- function should return NULL if no whitespace should be added
- and the string to insert (spaces, tabs, carriage returns, and newlines)
- otherwise.
-The following whitespace callback can be used to add whitespace to
- XHTML output to make it more readable in a standard text editor:
-
- const char *
- whitespace_cb(mxml_node_t *node,
- int where)
- {
- const char *name;
-
- /*
- * We can conditionally break to a new line
- * before or after any element. These are
- * just common HTML elements...
- */
-
- name = node->value.element.name;
-
- if (!strcmp(name, "html") ||
- !strcmp(name, "head") ||
- !strcmp(name, "body") ||
- !strcmp(name, "pre") ||
- !strcmp(name, "p") ||
- !strcmp(name, "h1") ||
- !strcmp(name, "h2") ||
- !strcmp(name, "h3") ||
- !strcmp(name, "h4") ||
- !strcmp(name, "h5") ||
- !strcmp(name, "h6"))
- {
- /*
- * Newlines before open and after
- * close...
- */
-
- if (where == MXML_WS_BEFORE_OPEN ||
- where == MXML_WS_AFTER_CLOSE)
- return ("\n");
- }
- else if (!strcmp(name, "dl") ||
- !strcmp(name, "ol") ||
- !strcmp(name, "ul"))
- {
- /*
- * Put a newline before and after list
- * elements...
- */
-
- return ("\n");
- }
- else if (!strcmp(name, "dd") ||
- !strcmp(name, "dt") ||
- !strcmp(name, "li"))
- {
- /*
- * Put a tab before <li>'s, * <dd>'s,
- * and <dt>'s, and a newline after them...
- */
-
- if (where == MXML_WS_BEFORE_OPEN)
- return ("\t");
- else if (where == MXML_WS_AFTER_CLOSE)
- return ("\n");
- }
-
- /*
- * Return NULL for no added whitespace...
- */
-
- return (NULL);
- }
-
-To use this callback function, simply use the name when you call any
- of the save functions:
-
- FILE *fp;
- mxml_node_t *tree;
-
- fp = fopen("filename.xml", "w");
- mxmlSaveFile(tree, fp, whitespace_cb );
- fclose(fp);
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/SavingXML.html b/www/docfiles/SavingXML.html
deleted file mode 100644
index 6b1426f..0000000
--- a/www/docfiles/SavingXML.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-You save an XML file using the
-mxmlSaveFile function:
-
- FILE *fp;
- mxml_node_t *tree;
-
- fp = fopen("filename.xml", "w");
- mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
- fclose(fp);
-
-The first argument is the XML node tree to save. It should normally
- be a pointer to the top-level ?xml node in your XML document.
-The second argument is the stdio file to write to, as opened by
-fopen() or popen() . You can also use stdout if
- you are implementing an XML filter program.
-The third argument is the whitespace callback to use when saving the
- file. Whitespace callbacks are covered in detail in
-Chapter 3 . The previous example code uses the MXML_NO_CALLBACK
- constant to specify that no special whitespace handling is required.
-The
-mxmlSaveAllocString , and
-mxmlSaveString functions save XML node trees to strings:
-
- char buffer[8192];
- char *ptr;
- mxml_node_t *tree;
-
- ...
- mxmlSaveString(tree, buffer, sizeof(buffer),
- MXML_NO_CALLBACK);
-
- ...
- ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
-
-The first and last arguments are the same as used for
-mxmlSaveFile() . The mxmlSaveString function takes pointer
- and size arguments for saving the XML document to a fixed-size buffer,
- while mxmlSaveAllocString() returns a string buffer that was
- allocated using malloc() .
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Structures.html b/www/docfiles/Structures.html
deleted file mode 100644
index fd57cbb..0000000
--- a/www/docfiles/Structures.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/TheBasics.html b/www/docfiles/TheBasics.html
deleted file mode 100644
index 51b2f79..0000000
--- a/www/docfiles/TheBasics.html
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Mini-XML provides a single header file which you include:
-
- #include <mxml.h>
-
-The Mini-XML library is included with your program using the
--lmxml option:
-
- gcc -o myprogram myprogram.c -lmxml ENTER
-
-If you have the pkg-config(1) software installed, you can
- use it to determine the proper compiler and linker options for your
- installation:
-
- pkg-config --cflags mxml ENTER
- pkg-config --libs mxml ENTER
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/TheBasics1.html b/www/docfiles/TheBasics1.html
deleted file mode 100644
index 0fca6a8..0000000
--- a/www/docfiles/TheBasics1.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Originally developed to generate the Mini-XML and CUPS API
- documentation, mxmldoc is now a general-purpose utility which
- scans C and C++ source files to produce HTML and man page documentation
- along with an XML file representing the functions, types, and
- definitions in those source files. Unlike popular documentation
- generators like Doxygen or Javadoc, mxmldoc uses in-line
- comments rather than comment headers, allowing for more "natural" code
- documentation.
-By default, mxmldoc produces HTML documentation. For
- example, the following command will scan all of the C source and header
- files in the current directory and produce a HTML documentation file
- called filename.html :
-
- mxmldoc *.h *.c >filename.html ENTER
-
-You can also specify an XML file to create which contains all of the
- information from the source files. For example, the following command
- creates an XML file called filename.xml in addition to the
- HTML file:
-
- mxmldoc filename.xml *.h *.c >filename.html ENTER
-
-The --no-output option disables the normal HTML output:
-
- mxmldoc --no-output filename.xml *.h *.c ENTER
-
-You can then run mxmldoc again with the XML file alone to
- generate the HTML documentation:
-
- mxmldoc filename.xml >filename.html ENTER
-
-The --man filename option tells mxmldoc to create a
- man page instead of HTML documentation, for example:
-
- mxmldoc --man filename filename.xml \
- >filename.man ENTER
-
- mxmldoc --man filename *.h *.c \
- >filename.man ENTER
-
- mxmldoc --man filename filename.xml *.h *.c \
- >filename.man ENTER
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/TitlesSectionsandIntroductions.html b/www/docfiles/TitlesSectionsandIntroductions.html
deleted file mode 100644
index 847cb38..0000000
--- a/www/docfiles/TitlesSectionsandIntroductions.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-Mxmldoc also provides options to set the title, section, and
- introduction text for the generated documentation. The --title text
- option specifies the title for the documentation. The title string is
- usually put in quotes:
-
- mxmldoc filename.xml \
- --title "My Famous Documentation" \
- >filename.html ENTER
-
-The --section name option specifies the section for the
- documentation. For HTML documentation, the name is placed in a HTML
- comment such as:
-
- <!-- SECTION: name -->
-
-For man pages, the section name is usually just a number ("3"), or a
- number followed by a vendor name ("3acme"). The section name is used in
- the .TH directive in the man page:
-
- .TH mylibrary 3acme "My Title" ...
-
-The default section name for man page output is "3". There is no
- default section name for HTML output.
-Finally, the --intro filename option specifies a file to
- embed after the title and section but before the generated
- documentation. For HTML documentation, the file must consist of valid
- HTML without the usual DOCTYPE , html , and body
- elements. For man page documentation, the file must consist of valid
-nroff(1) text.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Types.html b/www/docfiles/Types.html
deleted file mode 100644
index 2fc5ea8..0000000
--- a/www/docfiles/Types.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/Unions.html b/www/docfiles/Unions.html
deleted file mode 100644
index c1f110d..0000000
--- a/www/docfiles/Unions.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
-
-
-
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/UsingthemxmldocUtility.html b/www/docfiles/UsingthemxmldocUtility.html
deleted file mode 100644
index 43759ec..0000000
--- a/www/docfiles/UsingthemxmldocUtility.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-Mini-XML Programmers Manual, Version 2.3
-
-
-
-
-
-
-
-
-
-
-Contents
-Previous
-Next
-
- Using the mxmldoc Utility
-This chapter describes how to use mxmldoc(1) program to
- automatically generate documentation from C and C++ source files.
-
-Contents
-Previous
-Next
-
-
diff --git a/www/docfiles/advanced.html b/www/docfiles/advanced.html
new file mode 100644
index 0000000..ddb0725
--- /dev/null
+++ b/www/docfiles/advanced.html
@@ -0,0 +1,578 @@
+
+
+
+Mini-XML Programmers Manual, Version 2.3
+
+
+
+
+
+
+
+
+
+
+Contents
+Previous
+Next
+
+ More Mini-XML Programming
+ Techniques
+This chapter shows additional ways to use the Mini-XML library in
+ your programs.
+
+Chapter 2 introduced the
+mxmlLoadFile() and
+mxmlLoadString() functions. The last argument to these
+ 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:
+
+MXML_INTEGER_CALLBACK - All data nodes contain
+ whitespace-separated integers.
+MXML_OPAQUE_CALLBACK - All data nodes contain opaque
+ strings ("CDATA").
+MXML_REAL_CALLBACK - All data nodes contain
+ whitespace-separated floating-point numbers.
+MXML_TEXT_CALLBACK - All data nodes contain
+ whitespace-separated strings.
+
+You can provide your own callback functions for more complex XML
+ documents. Your callback function will receive a pointer to the current
+ element node and must return the value type of the immediate children
+ for that element node: MXML_INTEGER , MXML_OPAQUE ,
+MXML_REAL , or MXML_TEXT . The function is called after
+ the element and its attributes have been read, so you can look at the
+ element name, attributes, and attribute values to determine the proper
+ value type to return.
+
+
+The following callback function looks for an attribute named "type"
+ or the element name to determine the value type for its child nodes:
+
+ mxml_type_t
+ type_cb(mxml_node_t *node)
+ {
+ const char *type;
+
+ /*
+ * You can lookup attributes and/or use the
+ * element name, hierarchy, etc...
+ */
+
+ type = mxmlElementGetAttr(node, "type");
+ if (type == NULL)
+ type = node->value.element.name;
+
+ if (!strcmp(type, "integer"))
+ return (MXML_INTEGER);
+ else if (!strcmp(type, "opaque"))
+ return (MXML_OPAQUE);
+ else if (!strcmp(type, "real"))
+ return (MXML_REAL);
+ else
+ return (MXML_TEXT);
+ }
+
+To use this callback function, simply use the name when you call any
+ of the load functions:
+
+ FILE *fp;
+ mxml_node_t *tree;
+
+ fp = fopen("filename.xml", "r");
+ tree = mxmlLoadFile(NULL, fp, type_cb );
+ fclose(fp);
+
+
+Chapter 2 also introduced the
+mxmlSaveFile() ,
+mxmlSaveString() , and
+mxmlSaveAllocString() functions. The last argument to these
+ functions is a callback function which is used to automatically insert
+ whitespace in an XML document.
+Your callback function will be called up to four times for each
+ element node with a pointer to the node and a "where" value of
+MXML_WS_BEFORE_OPEN , MXML_WS_AFTER_OPEN ,
+MXML_WS_BEFORE_CLOSE , or MXML_WS_AFTER_CLOSE . The callback
+ function should return NULL if no whitespace should be added
+ and the string to insert (spaces, tabs, carriage returns, and newlines)
+ otherwise.
+The following whitespace callback can be used to add whitespace to
+ XHTML output to make it more readable in a standard text editor:
+
+ const char *
+ whitespace_cb(mxml_node_t *node,
+ int where)
+ {
+ const char *name;
+
+ /*
+ * We can conditionally break to a new line
+ * before or after any element. These are
+ * just common HTML elements...
+ */
+
+ name = node->value.element.name;
+
+ if (!strcmp(name, "html") ||
+ !strcmp(name, "head") ||
+ !strcmp(name, "body") ||
+ !strcmp(name, "pre") ||
+ !strcmp(name, "p") ||
+ !strcmp(name, "h1") ||
+ !strcmp(name, "h2") ||
+ !strcmp(name, "h3") ||
+ !strcmp(name, "h4") ||
+ !strcmp(name, "h5") ||
+ !strcmp(name, "h6"))
+ {
+ /*
+ * Newlines before open and after
+ * close...
+ */
+
+ if (where == MXML_WS_BEFORE_OPEN ||
+ where == MXML_WS_AFTER_CLOSE)
+ return ("\n");
+ }
+ else if (!strcmp(name, "dl") ||
+ !strcmp(name, "ol") ||
+ !strcmp(name, "ul"))
+ {
+ /*
+ * Put a newline before and after list
+ * elements...
+ */
+
+ return ("\n");
+ }
+ else if (!strcmp(name, "dd") ||
+ !strcmp(name, "dt") ||
+ !strcmp(name, "li"))
+ {
+ /*
+ * Put a tab before <li>'s, * <dd>'s,
+ * and <dt>'s, and a newline after them...
+ */
+
+ if (where == MXML_WS_BEFORE_OPEN)
+ return ("\t");
+ else if (where == MXML_WS_AFTER_CLOSE)
+ return ("\n");
+ }
+
+ /*
+ * Return NULL for no added whitespace...
+ */
+
+ return (NULL);
+ }
+
+To use this callback function, simply use the name when you call any
+ of the save functions:
+
+ FILE *fp;
+ mxml_node_t *tree;
+
+ fp = fopen("filename.xml", "w");
+ mxmlSaveFile(tree, fp, whitespace_cb );
+ fclose(fp);
+
+
+
+
+Mini-XML supports custom data types via global load and save
+ callbacks. Only a single set of callbacks can be active at any time,
+ 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 load callback receives a pointer to the current data node and a
+ string of opaque character data from the XML source with character
+ entities converted to the corresponding UTF-8 characters. For example,
+ if we wanted to support a custom date/time type whose value is encoded
+ as "yyyy-mm-ddThh:mm:ssZ" (ISO format), the load callback would look
+ like the following:
+
+ typedef struct
+ {
+ unsigned year, /* Year */
+ month, /* Month */
+ day, /* Day */
+ hour, /* Hour */
+ minute, /* Minute */
+ second; /* Second */
+ time_t unix; /* UNIX time */
+ } iso_date_time_t;
+
+ int
+ load_custom(mxml_node_t *node,
+ const char *data)
+ {
+ iso_date_time_t *dt;
+ struct tm tmdata;
+
+ /*
+ * Allocate data structure...
+ */
+
+ dt = calloc(1, sizeof(iso_date_time_t));
+
+ /*
+ * Try reading 6 unsigned integers from the
+ * data string...
+ */
+
+ if (sscanf(data, "%u-%u-%uT%u:%u:%uZ",
+ &(dt->year), &(dt->month),
+ &(dt->day), &(dt->hour),
+ &(dt->minute),
+ &(dt->second)) != 6)
+ {
+ /*
+ * Unable to read numbers, free the data
+ * structure and return an error...
+ */
+
+ free(dt);
+
+ return (-1);
+ }
+
+ /*
+ * Range check values...
+ */
+
+ if (dt->month <1 || dt->month > 12 ||
+ dt->day <1 || dt->day > 31 ||
+ dt->hour <0 || dt->hour > 23 ||
+ dt->minute <0 || dt->minute > 59 ||
+ dt->second <0 || dt->second > 59)
+ {
+ /*
+ * Date information is out of range...
+ */
+
+ free(dt);
+
+ return (-1);
+ }
+
+ /*
+ * Convert ISO time to UNIX time in
+ * seconds...
+ */
+
+ tmdata.tm_year = dt->year - 1900;
+ tmdata.tm_mon = dt->month - 1;
+ tmdata.tm_day = dt->day;
+ tmdata.tm_hour = dt->hour;
+ tmdata.tm_min = dt->minute;
+ tmdata.tm_sec = dt->second;
+
+ dt->unix = gmtime(&tmdata);
+
+ /*
+ * Assign custom node data and destroy
+ * function pointers...
+ */
+
+ node->value.custom.data = dt;
+ node->value.custom.destroy = free;
+
+ /*
+ * Return with no errors...
+ */
+
+ return (0);
+ }
+
+The function itself can return 0 on success or -1 if it is unable to
+ decode the custom data or the data contains an error. Custom data nodes
+ contain a void pointer to the allocated custom data for the
+ node and a pointer to a destructor function which will free the custom
+ data when the node is deleted.
+The save callback receives the node pointer and returns an allocated
+ string containing the custom data value. The following save callback
+ could be used for our ISO date/time type:
+
+ char *
+ save_custom(mxml_node_t *node)
+ {
+ char data[255];
+ iso_date_time_t *dt;
+
+
+ dt = (iso_date_time_t *)node->custom.data;
+
+ snprintf(data, sizeof(data),
+ "%04u-%02u-%02uT%02u:%02u:%02uZ",
+ dt->year, dt->month, dt->day,
+ dt->hour, dt->minute, dt->second);
+
+ return (strdup(data));
+ }
+
+You register the callback functions using the
+mxmlSetCustomHandlers() function:
+
+ mxmlSetCustomHandlers(load_custom ,
+ save_custom );
+
+
+
+
+All of the examples so far have concentrated on creating and loading
+ new XML data nodes. Many applications, however, need to manipulate or
+ change the nodes during their operation, so Mini-XML provides functions
+ to change node values safely and without leaking memory.
+Existing nodes can be changed using the
+mxmlSetElement() ,
+mxmlSetInteger() ,
+mxmlSetOpaque() ,
+mxmlSetReal() ,
+mxmlSetText() , and
+mxmlSetTextf() functions. For example, use the following
+ function call to change a text node to contain the text "new" with
+ leading whitespace:
+
+ mxml_node_t *node;
+
+ mxmlSetText(node, 1, "new");
+
+
+The mxmlNewTextf()
+ and mxmlSetTextf()
+ functions create and change text nodes, respectively, using printf
+-style format strings and arguments. For example, use the following
+ function call to create a new text node containing a constructed
+ filename:
+
+ mxml_node_t *node;
+
+ node = mxmlNewTextf(node, 1, "%s/%s",
+ path, filename);
+
+
+Mini-XML provides functions for managing indices of nodes. The
+ current implementation provides the same functionality as
+mxmlFindElement() . The advantage of using an index is that
+ searching and enumeration of elements is significantly faster. The only
+ disadvantage is that each index is a static snapshot of the XML
+ document, so indices are not well suited to XML data that is updated
+ more often than it is searched. The overhead of creating an index is
+ approximately equal to walking the XML document tree. Nodes in the
+ index are sorted by element name and attribute value.
+Indices are stored in
+mxml_index_t structures. The
+mxmlIndexNew() function creates a new index:
+
+ mxml_node_t *tree;
+ mxml_index_t *ind;
+
+ ind = mxmlIndexNew(tree, "element",
+ "attribute");
+
+The first argument is the XML node tree to index. Normally this will
+ be a pointer to the ?xml element.
+The second argument contains the element to index; passing NULL
+ indexes all element nodes alphabetically.
+The third argument contains the attribute to index; passing NULL
+ causes only the element name to be indexed.
+Once the index is created, the
+mxmlIndexEnum() ,
+mxmlIndexFind() , and
+mxmlIndexReset() functions are used to access the nodes in the
+ index. The mxmlIndexReset()
+ function resets the "current" node pointer in the index, allowing
+ you to do new searches and enumerations on the same index. Typically
+ you will call this function prior to your calls to
+mxmlIndexEnum() and
+mxmlIndexFind() .
+The mxmlIndexEnum()
+ function enumerates each of the nodes in the index and can be used in a
+ loop as follows:
+
+ mxml_node_t *node;
+
+ mxmlIndexReset(ind);
+
+ while ((node = mxmlIndexEnum(ind)) != NULL)
+ {
+ // do something with node
+ }
+
+The mxmlIndexFind()
+ function locates the next occurrence of the named element and attribute
+ value in the index. It can be used to find all matching elements in an
+ index, as follows:
+
+ mxml_node_t *node;
+
+ mxmlIndexReset(ind);
+
+ while ((node = mxmlIndexFind(ind, "element",
+ "attr-value"))
+ != NULL)
+ {
+ // do something with node
+ }
+
+The second and third arguments represent the element name and
+ attribute value, respectively. A NULL pointer is used to
+ return all elements or attributes in the index. Passing NULL
+ for both the element name and attribute value is equivalent to calling
+mxmlIndexEnum .
+When you are done using the index, delete it using the
+mxmlIndexDelete() function:
+
+ mxmlIndexDelete(ind);
+
+
+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.
+ Each function works like the corresponding mxmlLoad function
+ but uses a callback to process each node as it is read.
+The callback function receives the node, an event code, and a user
+ data pointer you supply:
+
+ void
+ sax_cb(mxml_node_t *node,
+ mxml_sax_event_t event,
+ void *data)
+ {
+ ... do something ...
+ }
+
+The event will be one of the following:
+
+MXML_SAX_CDATA - CDATA was just read
+MXML_SAX_COMMENT - A comment was just read
+MXML_SAX_DATA - Data (custom, integer, opaque, real, or
+ text) was just read
+MXML_SAX_DIRECTIVE - A processing directive was just read
+MXML_SAX_ELEMENT_CLOSE - An open element was just read (
+<element> )
+MXML_SAX_ELEMENT_OPEN - A close element was just read (
+</element> )
+
+Elements are released after the close element is processed.
+ All other nodes are released after they are processed. The SAX callback
+ can retain the node using the
+mxmlRetain function. For example, the following SAX
+ callback will retain all nodes, effectively simulating a normal
+ in-memory load:
+
+ void
+ sax_cb(mxml_node_t *node,
+ mxml_sax_event_t event,
+ void *data)
+ {
+ if (event != MXML_SAX_ELEMENT_CLOSE)
+ mxmlRetain(node);
+ }
+
+More typically the SAX callback will only retain a small portion of
+ the document that is needed for post-processing. For example, the
+ following SAX callback will retain the title and headings in an XHTML
+ file. It also retains the (parent) elements like <html> ,
+<head> , and <body> , and processing directives like
+<?xml ... ?> and <!DOCTYPE ... > :
+
+
+
+ void
+ sax_cb(mxml_node_t *node,
+ mxml_sax_event_t event,
+ void *data)
+ {
+ if (event == MXML_SAX_ELEMENT_OPEN)
+ {
+ /*
+ * Retain headings and titles...
+ */
+
+ char *name = node->value.element.name;
+
+ if (!strcmp(name, "html") ||
+ !strcmp(name, "head") ||
+ !strcmp(name, "title") ||
+ !strcmp(name, "body") ||
+ !strcmp(name, "h1") ||
+ !strcmp(name, "h2") ||
+ !strcmp(name, "h3") ||
+ !strcmp(name, "h4") ||
+ !strcmp(name, "h5") ||
+ !strcmp(name, "h6"))
+ mxmlRetain(node);
+ }
+ else if (event == MXML_SAX_DIRECTIVE)
+ mxmlRetain(node);
+ else if (event == MXML_SAX_DATA &&
+ node->parent->ref_count > 1)
+ {
+ /*
+ * If the parent was retained, then retain
+ * this data node as well.
+ */
+
+ mxmlRetain(node);
+ }
+ }
+
+The resulting skeleton document tree can then be searched just like
+ one loaded using the mxmlLoad functions. For example, a filter
+ that reads an XHTML document from stdin and then shows the title and
+ headings in the document would look like:
+
+ mxml_node_t *doc, *title, *body, *heading;
+
+ doc = mxmlSAXLoadFd(NULL, 0,
+ MXML_TEXT_CALLBACK,
+ sax_cb , NULL);
+
+ title = mxmlFindElement(doc, doc, "title",
+ NULL, NULL,
+ MXML_DESCEND);
+
+ if (title)
+ print_children(title);
+
+ body = mxmlFindElement(doc, doc, "body",
+ NULL, NULL,
+ MXML_DESCEND);
+
+ if (body)
+ {
+ for (heading = body->child;
+ heading;
+ heading = heading->next)
+ print_children(heading);
+ }
+
+
+Contents
+Previous
+Next
+
+
diff --git a/www/docfiles/basics.html b/www/docfiles/basics.html
new file mode 100644
index 0000000..16860b0
--- /dev/null
+++ b/www/docfiles/basics.html
@@ -0,0 +1,440 @@
+
+
+
+Mini-XML Programmers Manual, Version 2.3
+
+
+
+
+
+
+
+
+
+
+Contents
+Previous
+Next
+
+ Getting Started with Mini-XML
+This chapter describes how to write programs that use Mini-XML to
+ access data in an XML file. Mini-XML provides the following
+ functionality:
+
+Functions for creating and managing XML documents in memory.
+Reading of UTF-8 and UTF-16 encoded XML files and strings.
+Writing of UTF-8 encoded XML files and strings.
+Support for arbitrary element names, attributes, and attribute
+ values with no preset limits, just available memory.
+Support for integer, real, opaque ("cdata"), and text data types in
+ "leaf" nodes.
+"Find", "index", and "walk" functions for easily accessing data in
+ an XML document.
+
+Mini-XML doesn't do validation or other types of processing on the
+ data based upon schema files or other sources of definition
+ information, nor does it support character entities other than those
+ required by the XML specification.
+
+Mini-XML provides a single header file which you include:
+
+ #include <mxml.h>
+
+The Mini-XML library is included with your program using the
+-lmxml option:
+
+ gcc -o myprogram myprogram.c -lmxml ENTER
+
+If you have the pkg-config(1) software installed, you can
+ use it to determine the proper compiler and linker options for your
+ installation:
+
+ pkg-config --cflags mxml ENTER
+ pkg-config --libs mxml ENTER
+
+
+Every piece of information in an XML file (elements, text, numbers)
+ is stored in memory in "nodes". 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.
+
+
+
+ Table 2-1: Mini-XML Node Value
+ Members
+Value Type Node member
+Custom void *
+node->value.custom.data
+Element char *
+node->value.element.name
+Integer int node->value.integer
+
+Opaque (string) char *
+node->value.opaque
+Real double node->value.real
+
+Text char * node->value.text.string
+
+
+
+Each node also has a user_data member which allows you to
+ associate application-specific data with each node as needed.
+New nodes are created using the
+mxmlNewElement ,
+mxmlNewInteger ,
+mxmlNewOpaque ,
+mxmlNewReal , mxmlNewText
+ mxmlNewTextf
+mxmlNewXML functions. Only elements can have child nodes,
+ and the top node must be an element, usually the <?xml
+ version="1.0"?> node created by mxmlNewXML() .
+Nodes have pointers to the node above (parent ), below (
+child ), left (prev ), and right (next ) of the
+ current node. If you have an XML file like the following:
+
+ <?xml version="1.0"?>
+ <data>
+ <node>val1</node>
+ <node>val2</node>
+ <node>val3</node>
+ <group>
+ <node>val4</node>
+ <node>val5</node>
+ <node>val6</node>
+ </group>
+ <node>val7</node>
+ <node>val8</node>
+ </data>
+
+the node tree for the file would look like the following in memory:
+
+ ?xml
+ |
+ data
+ |
+ node - node - node - group - node - node
+ | | | | | |
+ val1 val2 val3 | val7 val8
+ |
+ node - node - node
+ | | |
+ val4 val5 val6
+
+where "-" is a pointer to the next node and "|" is a pointer to the
+ first child node.
+Once you are done with the XML data, use the
+mxmlDelete function to recursively free the memory that is
+ used for a particular node or the entire tree:
+
+ mxmlDelete(tree);
+
+
+
+
+You can create and update XML documents in memory using the various
+mxmlNew functions. The following code will create the XML document
+ described in the previous section:
+
+ mxml_node_t *xml; /* <?xml ... ?> */
+ mxml_node_t *data; /* <data> */
+ mxml_node_t *node; /* <node> */
+ mxml_node_t *group; /* <group> */
+
+ xml = mxmlNewXML("1.0");
+
+ data = mxmlNewElement(xml, "data");
+
+ node = mxmlNewElement(data, "node");
+ mxmlNewText(node, 0, "val1");
+ node = mxmlNewElement(data, "node");
+ mxmlNewText(node, 0, "val2");
+ node = mxmlNewElement(data, "node");
+ mxmlNewText(node, 0, "val3");
+
+ group = mxmlNewElement(data, "group");
+
+ node = mxmlNewElement(group, "node");
+ mxmlNewText(node, 0, "val4");
+ node = mxmlNewElement(group, "node");
+ mxmlNewText(node, 0, "val5");
+ node = mxmlNewElement(group, "node");
+ mxmlNewText(node, 0, "val6");
+
+ node = mxmlNewElement(data, "node");
+ mxmlNewText(node, 0, "val7");
+ node = mxmlNewElement(data, "node");
+ mxmlNewText(node, 0, "val8");
+
+We start by creating the <?xml version="1.0"?> node common
+ to all XML files using the
+mxmlNewXML function:
+
+ xml = mxmlNewXML("1.0");
+
+We then create the <data> node used for this document using
+ the mxmlNewElement
+ function. The first argument specifies the parent node (xml )
+ while the second specifies the element name (data ):
+
+ data = mxmlNewElement(xml, "data");
+
+Each <node>...</node> in the file is created using the
+mxmlNewElement and
+mxmlNewText functions. The first argument of mxmlNewText
+ specifies the parent node (node ). The second argument
+ specifies whether whitespace appears before the text - 0 or false in
+ this case. The last argument specifies the actual text to add:
+
+ node = mxmlNewElement(data, "node");
+ mxmlNewText(node, 0, "val1");
+
+The resulting in-memory XML document can then be saved or processed
+ just like one loaded from disk or a string.
+
+
+
+You load an XML file using the
+mxmlLoadFile function:
+
+ FILE *fp;
+ mxml_node_t *tree;
+
+ fp = fopen("filename.xml", "r");
+ tree = mxmlLoadFile(NULL, fp,
+ MXML_TEXT_CALLBACK);
+ fclose(fp);
+
+The first argument specifies an existing XML parent node, if any.
+ Normally you will pass NULL for this argument unless you are
+ combining multiple XML sources. The XML file must contain a complete
+ XML document including the ?xml element if the parent node is
+NULL .
+The second argument specifies the stdio file to read from, as opened
+ by fopen() or popen() . You can also use stdin
+ if you are implementing an XML filter program.
+The third argument specifies a callback function which returns the
+ value type of the immediate children for a new element node:
+MXML_CUSTOM , MXML_IGNORE , MXML_INTEGER ,
+MXML_OPAQUE , MXML_REAL , or MXML_TEXT . Load
+ callbacks are described in detail in
+Chapter 3 . The example code uses the MXML_TEXT_CALLBACK
+ constant which specifies that all data nodes in the document contain
+ whitespace-separated text values. Other standard callbacks include
+MXML_IGNORE_CALLBACK , MXML_INTEGER_CALLBACK ,
+MXML_OPAQUE_CALLBACK , and MXML_REAL_CALLBACK .
+The mxmlLoadString
+ function loads XML node trees from a string:
+
+
+
+ char buffer[8192];
+ mxml_node_t *tree;
+
+ ...
+ tree = mxmlLoadString(NULL, buffer,
+ MXML_TEXT_CALLBACK);
+
+The first and third arguments are the same as used for
+mxmlLoadFile() . The second argument specifies the string or
+ character buffer to load and must be a complete XML document including
+ the ?xml element if the parent node is NULL .
+
+
+
+You save an XML file using the
+mxmlSaveFile function:
+
+ FILE *fp;
+ mxml_node_t *tree;
+
+ fp = fopen("filename.xml", "w");
+ mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
+ fclose(fp);
+
+The first argument is the XML node tree to save. It should normally
+ be a pointer to the top-level ?xml node in your XML document.
+The second argument is the stdio file to write to, as opened by
+fopen() or popen() . You can also use stdout if
+ you are implementing an XML filter program.
+The third argument is the whitespace callback to use when saving the
+ file. Whitespace callbacks are covered in detail in
+Chapter 3 . The previous example code uses the MXML_NO_CALLBACK
+ constant to specify that no special whitespace handling is required.
+The mxmlSaveAllocString
+ , and mxmlSaveString
+ functions save XML node trees to strings:
+
+ char buffer[8192];
+ char *ptr;
+ mxml_node_t *tree;
+
+ ...
+ mxmlSaveString(tree, buffer, sizeof(buffer),
+ MXML_NO_CALLBACK);
+
+ ...
+ ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
+
+The first and last arguments are the same as used for
+mxmlSaveFile() . The mxmlSaveString function takes pointer
+ and size arguments for saving the XML document to a fixed-size buffer,
+ while mxmlSaveAllocString() returns a string buffer that was
+ allocated using malloc() .
+
+When saving XML documents, Mini-XML normally wraps output lines at
+ column 75 so that the text is readable in terminal windows. The
+mxmlSetWrapMargin function overrides the default wrap
+ margin:
+
+ /* Set the margin to 132 columns */
+ mxmlSetWrapMargin(132);
+
+ /* Disable wrapping */
+ mxmlSetWrapMargin(0);
+
+
+
+
+The mxmlWalkPrev and mxmlWalkNext functions can
+ be used to iterate through the XML node tree:
+
+ mxml_node_t *node;
+
+ node = mxmlWalkPrev(current, tree,
+ MXML_DESCEND);
+
+ node = mxmlWalkNext(current, tree,
+ MXML_DESCEND);
+
+In addition, you can find a named element/node using the
+mxmlFindElement function:
+
+ mxml_node_t *node;
+
+ node = mxmlFindElement(tree, tree, "name",
+ "attr", "value",
+ MXML_DESCEND);
+
+The name , attr , and value arguments can be
+ passed as NULL to act as wildcards, e.g.:
+
+
+
+ /* Find the first "a" element */
+ node = mxmlFindElement(tree, tree, "a",
+ NULL, NULL,
+ MXML_DESCEND);
+
+
+
+
+ /* Find the first "a" element with "href"
+ attribute */
+ node = mxmlFindElement(tree, tree, "a",
+ "href", NULL,
+ MXML_DESCEND);
+
+
+
+
+ /* Find the first "a" element with "href"
+ to a URL */
+ node = mxmlFindElement(tree, tree, "a",
+ "href",
+ "http://www.easysw.com/",
+ MXML_DESCEND);
+
+
+
+
+ /* Find the first element with a "src"
+ attribute */
+ node = mxmlFindElement(tree, tree, NULL,
+ "src", NULL,
+ MXML_DESCEND);
+
+
+
+
+ /* Find the first element with a "src"
+ = "foo.jpg" */
+ node = mxmlFindElement(tree, tree, NULL,
+ "src", "foo.jpg",
+ MXML_DESCEND);
+
+You can also iterate with the same function:
+
+ mxml_node_t *node;
+
+ for (node = mxmlFindElement(tree, tree,
+ "name",
+ NULL, NULL,
+ MXML_DESCEND);
+ node != NULL;
+ node = mxmlFindElement(node, tree,
+ "name",
+ NULL, NULL,
+ MXML_DESCEND))
+ {
+ ... do something ...
+ }
+
+
+
+The MXML_DESCEND argument can actually be one of three
+ constants:
+
+MXML_NO_DESCEND means to not to look at any child nodes in
+ the element hierarchy, just look at siblings at the same level or
+ parent nodes until the top node or top-of-tree is reached.
+The previous node from "group" would be the "node" element to the
+ left, while the next node from "group" would be the "node" element to
+ the right.
+
+
+
+MXML_DESCEND_FIRST means that it is OK to descend to the
+ first child of a node, but not to descend further when searching.
+ You'll normally use this when iterating through direct children of a
+ parent node, e.g. all of the "node" and "group" elements under the
+ "?xml" parent node in the example above.
+This mode is only applicable to the search function; the walk
+ functions treat this as MXML_DESCEND since every call is a
+ first time.
+
+
+
+MXML_DESCEND means to keep descending until you hit the
+ bottom of the tree. The previous node from "group" would be the "val3"
+ node and the next node would be the first node element under "group".
+If you were to walk from the root node "?xml" to the end of the tree
+ with mxmlWalkNext() , the order would be:
+?xml data node val1 node val2 node val3 group node val4 node val5
+ node val6 node val7 node val8
+If you started at "val8" and walked using mxmlWalkPrev() ,
+ the order would be reversed, ending at "?xml".
+
+
+
+Contents
+Previous
+Next
+
+
diff --git a/www/docfiles/index.html b/www/docfiles/index.html
index a8ba612..c6e4550 100644
--- a/www/docfiles/index.html
+++ b/www/docfiles/index.html
@@ -24,185 +24,166 @@ A { text-decoration: none }
-Introduction
+Introduction
-
-Building, Installing, and Packaging Mini-XML
+Building, Installing, and Packaging
+ Mini-XML
-Getting Started with
- Mini-XML
+Getting Started with Mini-XML
-More
- Mini-XML Programming Techniques
+More Mini-XML Programming Techniques
+
-Using the mxmldoc
- Utility
+Using the mxmldoc Utility
-Mini-XML License
+Mini-XML License
-Release Notes
+Release Notes
-Library Reference
+Library Reference
-XML Schema
+XML Schema
-