mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 11:25:30 +00:00
More documentation fun.
Move version definition to configure script. Add XML schema for the mxmldoc output.
This commit is contained in:
parent
03930e80cb
commit
537afc37da
4
CHANGES
4
CHANGES
@ -3,11 +3,13 @@ README - 05/01/2004
|
||||
|
||||
CHANGES IN Mini-XML 2.0
|
||||
|
||||
- New programmers manual.
|
||||
- Changed the whitespace callback interface to return
|
||||
strings instead of a single character, allowing for
|
||||
greater control over the formatting of XML files
|
||||
written using Mini-XML. THIS CHANGE WILL REQUIRE
|
||||
CHANGES TO YOUR CODE IF YOU USE WHITESPACE CALLBACKS.
|
||||
CHANGES TO YOUR 1.x CODE IF YOU USE WHITESPACE
|
||||
CALLBACKS.
|
||||
- The mxmldoc utility is now capable of documenting C++
|
||||
classes, functions, and structures, and correctly
|
||||
handles C++ comments.
|
||||
|
18
Makefile.in
18
Makefile.in
@ -1,7 +1,7 @@
|
||||
#
|
||||
# "$Id: Makefile.in,v 1.18 2004/05/01 23:41:51 mike Exp $"
|
||||
# "$Id: Makefile.in,v 1.19 2004/05/02 16:04:40 mike Exp $"
|
||||
#
|
||||
# Makefile for mini-XML, a small XML-like file parsing library.
|
||||
# Makefile for Mini-XML, a small XML-like file parsing library.
|
||||
#
|
||||
# Copyright 2003-2004 by Michael Sweet.
|
||||
#
|
||||
@ -114,6 +114,8 @@ install: $(TARGETS)
|
||||
$(CP) mxml.h $(BUILDROOT)$(includedir)
|
||||
-$(MKDIR) -p $(BUILDROOT)$(libdir)
|
||||
$(CP) libmxml.a $(BUILDROOT)$(libdir)
|
||||
-$(MKDIR) -p $(BUILDROOT)$(libdir)/pkgconfig
|
||||
$(CP) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
|
||||
-$(MKDIR) -p $(BUILDROOT)$(mandir)/cat1
|
||||
$(CP) doc/mxmldoc.$(CAT1EXT) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
|
||||
-$(MKDIR) -p $(BUILDROOT)$(mandir)/cat3
|
||||
@ -133,12 +135,22 @@ uninstall:
|
||||
$(RM) -r $(BUILDROOT)$(docdir)
|
||||
$(RM) $(BUILDROOT)$(includedir)/mxml.h
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
|
||||
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
|
||||
$(RM) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
|
||||
$(RM) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
|
||||
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
|
||||
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
|
||||
|
||||
|
||||
#
|
||||
# Make packages using EPM (http://www.easysw.com/epm/)
|
||||
#
|
||||
|
||||
epm: all
|
||||
epm --output-dir dist -v -f native mxml
|
||||
epm --output-dir dist -v -f portable mxml
|
||||
|
||||
|
||||
#
|
||||
# autoconf stuff...
|
||||
#
|
||||
@ -244,5 +256,5 @@ $(OBJS): Makefile config.h
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile.in,v 1.18 2004/05/01 23:41:51 mike Exp $".
|
||||
# End of "$Id: Makefile.in,v 1.19 2004/05/02 16:04:40 mike Exp $".
|
||||
#
|
||||
|
14
README
14
README
@ -1,10 +1,10 @@
|
||||
README - 12/21/2003
|
||||
README - 05/01/2004
|
||||
-------------------
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
This README file describes the Mini-XML library version 1.3.
|
||||
This README file describes the Mini-XML library version 2.0.
|
||||
|
||||
Mini-XML is a small XML parsing library that you can use to
|
||||
read XML and XML-like data files in your application without
|
||||
@ -73,12 +73,10 @@ INSTALLING Mini-XML
|
||||
|
||||
DOCUMENTATION
|
||||
|
||||
The documentation is currently a work in progress. Aside
|
||||
from the information that follows, the "documentation.html"
|
||||
page provides a handy reference and is automatically
|
||||
generated using Mini-XML. You can also look at the
|
||||
"testmxml.c" and "mxmldoc.c" source files for examples of
|
||||
using Mini-XML.
|
||||
The documentation is available in the "doc" subdirectory in
|
||||
the files "mxml.html" (HTML) and "mxml.pdf" (PDF). You can
|
||||
also look at the "testmxml.c" and "mxmldoc.c" source files
|
||||
for examples of using Mini-XML.
|
||||
|
||||
Mini-XML provides a single header file which you include:
|
||||
|
||||
|
3
TODO
3
TODO
@ -24,3 +24,6 @@ TODO - 05/01/2004
|
||||
-- Make this the core implementation which the C API accesses?
|
||||
-- Class would allow for subclassing, is that necessary?
|
||||
- Binary XML support???
|
||||
- Character entity support
|
||||
-- Add support for a callback which returns a Unicode
|
||||
char from an entity name.
|
||||
|
13
config.h.in
13
config.h.in
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: config.h.in,v 1.4 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: config.h.in,v 1.5 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Configuration file for mini-XML, a small XML-like file parsing library.
|
||||
* Configuration file for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -27,6 +27,13 @@
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
/*
|
||||
* Version number...
|
||||
*/
|
||||
|
||||
#define MXML_VERSION ""
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the snprintf() and vsnprintf() functions?
|
||||
*/
|
||||
@ -59,5 +66,5 @@ extern int mxml_vsnprintf(char *, size_t, const char *, va_list);
|
||||
# endif /* !HAVE_VSNPRINTF */
|
||||
|
||||
/*
|
||||
* End of "$Id: config.h.in,v 1.4 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: config.h.in,v 1.5 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
13
configure.in
13
configure.in
@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl "$Id: configure.in,v 1.9 2004/04/06 01:47:20 mike Exp $"
|
||||
dnl "$Id: configure.in,v 1.10 2004/05/02 16:04:40 mike Exp $"
|
||||
dnl
|
||||
dnl Configuration script for mini-XML, a small XML-like file parsing library.
|
||||
dnl Configuration script for Mini-XML, a small XML-like file parsing library.
|
||||
dnl
|
||||
dnl Copyright 2003-2004 by Michael Sweet.
|
||||
dnl
|
||||
@ -16,6 +16,11 @@ dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
|
||||
dnl Version number...
|
||||
VERSION="2.0rc1"
|
||||
AC_SUBST(VERSION)
|
||||
AC_DEFINE(MXML_VERSION, "$VERSION")
|
||||
|
||||
dnl Specify a source file from the distribution...
|
||||
AC_INIT(mxml.h)
|
||||
|
||||
@ -164,8 +169,8 @@ AC_SUBST(MAN1EXT)
|
||||
AC_SUBST(MAN3EXT)
|
||||
|
||||
dnl Output the makefile, etc...
|
||||
AC_OUTPUT(Makefile mxml.list)
|
||||
AC_OUTPUT(Makefile mxml.list mxml.pc)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: configure.in,v 1.9 2004/04/06 01:47:20 mike Exp $".
|
||||
dnl End of "$Id: configure.in,v 1.10 2004/05/02 16:04:40 mike Exp $".
|
||||
dnl
|
||||
|
@ -4,6 +4,18 @@
|
||||
<h1 align='right'><a name='ADVANCED'>3 - More Mini-XML
|
||||
Programming Techniques</a></h1>
|
||||
|
||||
<p>This chapter shows additional ways to use the Mini-XML
|
||||
library in your programs.</p>
|
||||
|
||||
<h2>Load Callbacks</h2>
|
||||
|
||||
<h2>Save Callbacks</h2>
|
||||
|
||||
<h2>Changing Node Values</h2>
|
||||
|
||||
<h2>Formatted Text</h2>
|
||||
|
||||
<h2>Indexing</h2>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
290
doc/basics.html
290
doc/basics.html
@ -4,6 +4,296 @@
|
||||
<h1 align='right'><a name='BASICS'>2 - Getting Started with
|
||||
Mini-XML</a></h1>
|
||||
|
||||
<p>This chapter describes how to write programs that use
|
||||
Mini-XML to access data in an XML file.</p>
|
||||
|
||||
<h2>The Basics</h2>
|
||||
|
||||
<p>Mini-XML provides a single header file which you include:</p>
|
||||
|
||||
<pre>
|
||||
#include <mxml.h>
|
||||
</pre>
|
||||
|
||||
<p>The Mini-XML library is included with your program using the
|
||||
<kbd>-lmxml</kbd> option:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>gcc -o myprogram myprogram.c -lmxml ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<p>If you have the <tt>pkg-config(1)</tt> software installed,
|
||||
you can use it to determine the proper compiler and linker options
|
||||
for your installation:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>pkg-config --cflags mxml ENTER</kbd>
|
||||
<kbd>pkg-config --libs mxml ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<h2>Nodes</h2>
|
||||
|
||||
<p>Every piece of information in an XML file (elements, text,
|
||||
numbers) is stored in memory in "nodes". Nodes are defined by
|
||||
the <a
|
||||
href='reference.html#mxml_node_t'><tt>mxml_node_t</tt></a>
|
||||
structure. The <a
|
||||
href='reference.html#mxml_type_t'><tt>type</tt></a> member
|
||||
defines the node type (element, integer, opaque, real, or text)
|
||||
which determines which value you want to look at in the <a
|
||||
href='reference.html#mxml_value_t'><tt>value</tt></a> union.</p>
|
||||
|
||||
<p>New nodes can be created using the <a
|
||||
href='reference.html#mxmlNewElement'><tt>mxmlNewElement()</tt></a>,
|
||||
<a
|
||||
href='reference.html#mxmlNewInteger'><tt>mxmlNewInteger()</tt></a>,
|
||||
<a
|
||||
href='reference.html#mxmlNewOpaque'><tt>mxmlNewOpaque()</tt></a>,
|
||||
<a href='reference.html#mxmlNewReal'><tt>mxmlNewReal()</tt></a>,
|
||||
and <a
|
||||
href='reference.html#mxmlNewText'><tt>mxmlNewText()</tt></a>
|
||||
functions. Only elements can have child nodes, and the top node
|
||||
must be an element, usually "?xml".</p>
|
||||
|
||||
<p>Each node has pointers for the node above (<tt>parent</tt>),
|
||||
below (<tt>child</tt>), to the left (<tt>prev</tt>), and to the
|
||||
right (<tt>next</tt>) of the current node. If you have an XML
|
||||
file like the following:</p>
|
||||
|
||||
<pre>
|
||||
<?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>
|
||||
<node>val9</node>
|
||||
</data>
|
||||
</pre>
|
||||
|
||||
<p>the node tree returned by <tt>mxmlLoadFile()</tt> would look
|
||||
like the following in memory:</p>
|
||||
|
||||
<pre>
|
||||
?xml
|
||||
|
|
||||
data
|
||||
|
|
||||
node - node - node - group - node - node - node
|
||||
| | | | | | |
|
||||
val1 val2 val3 | val7 val8 val9
|
||||
|
|
||||
node - node - node
|
||||
| | |
|
||||
val4 val5 val6
|
||||
</pre>
|
||||
|
||||
<p>where "-" is a pointer to the next node and "|" is a pointer
|
||||
to the first child node.</p>
|
||||
|
||||
<p>Once you are done with the XML data, use the <a
|
||||
href='reference.html#mxmlDelete'><tt>mxmlDelete()</tt></a>
|
||||
function to recursively free the memory that is used for a
|
||||
particular node or the entire tree:</p>
|
||||
|
||||
<pre>
|
||||
mxmlDelete(tree);
|
||||
</pre>
|
||||
|
||||
<h2>Loading and Saving XML Files</h2>
|
||||
|
||||
<p>You load an XML file using the <a
|
||||
href='reference.html#mxmlLoadFile'><tt>mxmlLoadFile()</tt></a>
|
||||
function:</p>
|
||||
|
||||
<pre>
|
||||
FILE *fp;
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *tree;
|
||||
|
||||
fp = fopen("filename.xml", "r");
|
||||
tree = <a href='reference.html#mxmlLoadFile'>mxmlLoadFile</a>(NULL, fp, MXML_NO_CALLBACK);
|
||||
fclose(fp);
|
||||
</pre>
|
||||
|
||||
<p>The third argument specifies a callback function which
|
||||
returns the value type of the immediate children for a new
|
||||
element node: <tt>MXML_INTEGER</tt>, <tt>MXML_OPAQUE</tt>,
|
||||
<tt>MXML_REAL</tt>, or <tt>MXML_TEXT</tt>. This function is
|
||||
called <i>after</i> 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 default value type is MXML_TEXT if no callback is used.</p>
|
||||
|
||||
<p>Similarly, you save an XML file using the <a
|
||||
href='reference.html#mxmlSaveFile'><tt>mxmlSaveFile()</tt></a>
|
||||
function:</p>
|
||||
|
||||
<pre>
|
||||
FILE *fp;
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *tree;
|
||||
|
||||
fp = fopen("filename.xml", "w");
|
||||
<a href='reference.html#mxmlSaveFile'>mxmlSaveFile</a>(tree, fp, MXML_NO_CALLBACK);
|
||||
fclose(fp);
|
||||
</pre>
|
||||
|
||||
<p>Callback functions for saving are used to optionally insert
|
||||
whitespace before and after elements in the node tree. Your
|
||||
function will be called up to four times for each element node
|
||||
with a pointer to the node and a "where" value of
|
||||
<tt>MXML_WS_BEFORE_OPEN</tt>, <tt>MXML_WS_AFTER_OPEN</tt>,
|
||||
<tt>MXML_WS_BEFORE_CLOSE</tt>, or <tt>MXML_WS_AFTER_CLOSE</tt>.
|
||||
The callback function should return <tt>NULL</tt> if no
|
||||
whitespace should be added and the string to insert (spaces,
|
||||
tabs, carriage returns, and newlines) otherwise.</p>
|
||||
|
||||
<p>The <a
|
||||
href='reference.html#mxmlLoadString'><tt>mxmlLoadString()</tt></a>,
|
||||
<a
|
||||
href='reference.html#mxmlSaveAllocString'><tt>mxmlSaveAllocString()</tt></a>,
|
||||
and <a
|
||||
href='reference.html#mxmlSaveString'><tt>mxmlSaveString()</tt></a>
|
||||
functions load XML node trees from and save XML node trees to
|
||||
strings:</p>
|
||||
|
||||
<pre>
|
||||
char buffer[8192];
|
||||
char *ptr;
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *tree;
|
||||
|
||||
...
|
||||
tree = <a href='reference.html#mxmlLoadString'>mxmlLoadString</a>(NULL, buffer, MXML_NO_CALLBACK);
|
||||
|
||||
...
|
||||
<a href='reference.html#mxmlSaveString'>mxmlSaveString</a>(tree, buffer, sizeof(buffer), MXML_NO_CALLBACK);
|
||||
|
||||
...
|
||||
ptr = <a href='reference.html#mxmlSaveAllocString'>mxmlSaveAllocString</a>(tree, MXML_NO_CALLBACK);
|
||||
</pre>
|
||||
|
||||
<h3>Finding and Iterating Nodes</h3>
|
||||
|
||||
<p>The <a
|
||||
href='reference.html#mxmlWalkPrev'><tt>mxmlWalkPrev()</tt></a>
|
||||
and <a
|
||||
href='reference.html#mxmlWalkNext'><tt>mxmlWalkNext()</tt></a>functions
|
||||
can be used to iterate through the XML node tree:</p>
|
||||
|
||||
<pre>
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *node = <a href='reference.html#mxmlWalkPrev'>mxmlWalkPrev</a>(current, tree, MXML_DESCEND);
|
||||
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *node = <a href='reference.html#mxmlWalkNext'>mxmlWalkNext</a>(current, tree, MXML_DESCEND);
|
||||
</pre>
|
||||
|
||||
<p>In addition, you can find a named element/node using the <a
|
||||
href='reference.html#mxmlFindElement'><tt>mxmlFindElement()</tt></a>
|
||||
function:</p>
|
||||
|
||||
<pre>
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "name", "attr",
|
||||
"value", MXML_DESCEND);
|
||||
</pre>
|
||||
|
||||
<p>The <tt>name</tt>, <tt>attr</tt>, and <tt>value</tt>
|
||||
arguments can be passed as <tt>NULL</tt> to act as wildcards,
|
||||
e.g.:</p>
|
||||
|
||||
<pre>
|
||||
/* Find the first "a" element */
|
||||
node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "a", NULL, NULL, MXML_DESCEND);
|
||||
|
||||
/* Find the first "a" element with "href" attribute */
|
||||
node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "a", "href", NULL, MXML_DESCEND);
|
||||
|
||||
/* Find the first "a" element with "href" to a URL */
|
||||
node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "a", "href",
|
||||
"http://www.easysw.com/~mike/mxml/", MXML_DESCEND);
|
||||
|
||||
/* Find the first element with a "src" attribute*/
|
||||
node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, NULL, "src", NULL, MXML_DESCEND);
|
||||
|
||||
/* Find the first element with a "src" = "foo.jpg" */
|
||||
node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, NULL, "src", "foo.jpg", MXML_DESCEND);
|
||||
</pre>
|
||||
|
||||
<p>You can also iterate with the same function:</p>
|
||||
|
||||
<pre>
|
||||
<a href='reference.html#mxml_node_t'>mxml_node_t</a> *node;
|
||||
|
||||
for (node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "name", NULL, NULL, MXML_DESCEND);
|
||||
node != NULL;
|
||||
node = <a href='reference.html#mxmlFindElement'>mxmlFindElement</a>(node, tree, "name", NULL, NULL, MXML_DESCEND))
|
||||
{
|
||||
... do something ...
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The <tt>MXML_DESCEND</tt> argument can actually be one of
|
||||
three constants:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><tt>MXML_NO_DESCEND</tt> 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.</li>
|
||||
|
||||
<li><tt>MXML_DESCEND_FIRST</tt> 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" 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
|
||||
<tt>MXML_DESCEND</tt> since every call is a first
|
||||
time.</li>
|
||||
|
||||
<li><tt>MXML_DESCEND</tt> 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 <tt>mxmlWalkNext()</tt>, the order would be:
|
||||
|
||||
<pre>
|
||||
?xml
|
||||
data
|
||||
node
|
||||
val1
|
||||
node
|
||||
val2
|
||||
node
|
||||
val3
|
||||
group
|
||||
node
|
||||
val4
|
||||
node
|
||||
val5
|
||||
node
|
||||
val6
|
||||
node
|
||||
val7
|
||||
node
|
||||
val8
|
||||
node
|
||||
val9
|
||||
</pre>
|
||||
|
||||
<p>If you started at "val9" and walked using
|
||||
<tt>mxmlWalkPrev()</tt>, the order would be reversed,
|
||||
ending at "?xml".</p></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,9 +1,94 @@
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<h1 align='right'><a name='INSTALL'>1 - Building and Installing
|
||||
Mini-XML</a></h1>
|
||||
<h1 align='right'><a name='INSTALL'>1 - Building, Installing,
|
||||
and Packaging Mini-XML</a></h1>
|
||||
|
||||
<p>This chapter describes how to build, install, and package
|
||||
Mini-XML on your system.</p>
|
||||
|
||||
<h2>Compiling Mini-XML</h2>
|
||||
|
||||
<p>Mini-XML comes with an autoconf-based configure script; just
|
||||
type the following command to get things going:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>./configure ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<p>The default install prefix is <var>/usr/local</var>, which
|
||||
can be overridden using the <kbd>--prefix</kbd> option:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>./configure --prefix=/foo ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<p>Other configure options can be found using the
|
||||
<kbd>--help</kbd> option:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>./configure --help ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<p>Once you have configured the software, use the
|
||||
<tt>make(1)</tt> program to do the build and run the test
|
||||
program to verify that things are working, as follows:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>make ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<h2>Installing Mini-XML</h2>
|
||||
|
||||
<p>Use the <tt>make</tt> command with the <kbd>install</kbd>
|
||||
target to install Mini-XML in the configured directories:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>make install ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<h2>Creating Mini-XML Packages</h2>
|
||||
|
||||
<p>Mini-XML includes two files that can be used to create binary
|
||||
packages. The first file is <var>mxml.spec</var> which is used
|
||||
by the <tt>rpmbuild(8)</tt> software to create Red Hat Package
|
||||
Manager ("RPM") packages which are commonly used on Linux. Since
|
||||
<tt>rpmbuild</tt> wants to compile the software on its own, you
|
||||
can provide it with the Mini-XML tar file to build the
|
||||
package:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>rpmbuild -ta mxml-<i>version</i>.tar.gz ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<p>The second file is <var>mxml.list</var> which is used by the
|
||||
<tt>epm(1)</tt> program to create software packages in a variety
|
||||
of formats. The <tt>epm</tt> program is available from the
|
||||
following URL:</p>
|
||||
|
||||
<pre>
|
||||
<a href='http://www.easysw.com/epm/'>http://www.easysw.com/epm/</a>
|
||||
</pre>
|
||||
|
||||
<p>Use the <tt>make</tt> command with the <kbd>epm</kbd> target
|
||||
to create portable and native packages for your system:</p>
|
||||
|
||||
<pre>
|
||||
<kbd>make epm ENTER</kbd>
|
||||
</pre>
|
||||
|
||||
<p>The packages are stored in a subdirectory named
|
||||
<var>dist</var> for your convenience. The portable packages
|
||||
utilize scripts and tar files to install the software on the
|
||||
target system; this is especially useful when installing on
|
||||
systems with different Linux distributions. Use the
|
||||
<var>mxml.install</var> script to install the software and
|
||||
<var>mxml.remove</var> script to remove the software.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
267
doc/intro.html
267
doc/intro.html
@ -1,8 +1,275 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Mini-XML Programmers Manual, Version 2.0</title>
|
||||
<meta name='copyright' content='Copyright 2003-2004'/>
|
||||
<meta name='author' content='Michael Sweet'/>
|
||||
<meta name='keywords' content='XML, C, C++, library'/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 align='right'><a name='INTRO'>Introduction</a></h1>
|
||||
|
||||
<p>This programmers manual describes Mini-XML version 2.0, a
|
||||
small XML parsing library that you can use to read and write XML
|
||||
and XML-like data files in your application without requiring
|
||||
large non-standard libraries. Mini-XML only requires an ANSI C
|
||||
compatible compiler (GCC works, as do most vendors' ANSI C
|
||||
compilers) and a "make" program.</p>
|
||||
|
||||
<p>Mini-XML provides the following functionality:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Reading of UTF-8 and UTF-16 encoded XML files and
|
||||
strings.</li>
|
||||
|
||||
<li>Writing of UTF-8 encoded XML files and strings.</li>
|
||||
|
||||
<li>Data is stored in a linked-list tree structure,
|
||||
preserving the XML data hierarchy.</li>
|
||||
|
||||
<li>Supports arbitrary element names, attributes, and
|
||||
attribute values with no preset limits, just available
|
||||
memory.</li>
|
||||
|
||||
<li>Supports integer, real, opaque ("cdata"), and text
|
||||
data types in "leaf" nodes.</li>
|
||||
|
||||
<li>Functions for creating and managing trees of
|
||||
data.</li>
|
||||
|
||||
<li>"Find" and "walk" functions for easily locating and
|
||||
navigating trees of data.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<!-- NEED 4in -->
|
||||
<h2>Legal Stuff</h2>
|
||||
|
||||
<p>The Mini-XML library is copyright 2003-2004 by Michael
|
||||
Sweet.</p>
|
||||
|
||||
<p>This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the <a
|
||||
href='license.html#LICENSE'>GNU Library General Public
|
||||
License</a> as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later
|
||||
version.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<!-- NEED 4in -->
|
||||
<h2>History</h2>
|
||||
|
||||
<p>Mini-XML was initially developed for the <a
|
||||
href='http://gimp-print.sf.net/'>Gimp-Print</a> project to
|
||||
replace the rather large and unwieldy <tt>libxml2</tt> 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:</p>
|
||||
|
||||
<blockquote>It's bad enough that we require libxml2, but rolling
|
||||
our own XML parser is a bit more than we can
|
||||
handle.</blockquote>
|
||||
|
||||
<p>I then replied with:</p>
|
||||
|
||||
<blockquote>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.</blockquote>
|
||||
|
||||
<p>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 Gimp-Print
|
||||
and removed libxml2.</p>
|
||||
|
||||
<p>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 2,240
|
||||
lines of code, compared to 96,335 lines of code for libxml2
|
||||
version 2.6.9. Aside from Gimp-Print, Mini-XML is used for the
|
||||
following projects/software applications:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href='http://www.cups.org/'>Common UNIX Printing
|
||||
System</a></li>
|
||||
|
||||
<li><a href='http://www.cups.org/ddk.php'>CUPS Driver
|
||||
Development Kit</a></li>
|
||||
|
||||
<li><a href='http://www.easysw.com/printpro/'>ESP Print
|
||||
Pro</a></li>
|
||||
|
||||
<li><a
|
||||
href='http://zynaddsubfx.sourceforge.net'>ZynAddSubFX</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
<h2>Organization of This Document</h2>
|
||||
|
||||
<p>This manual is organized into the following chapters and
|
||||
appendices:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Chapter 1, "<a href='install.html#INSTALL'>Building,
|
||||
Installing, and Packaging Mini-XML</a>", provides
|
||||
compilation, installation, and packaging instructions for
|
||||
Mini-XML.</li>
|
||||
|
||||
<li>Chapter 2, "<a href='basics.html#BASICS'>Getting
|
||||
Started with Mini-XML</a>", shows how to use the
|
||||
Mini-XML library in your programs.</li>
|
||||
|
||||
<li>Chapter 3, "<a href='advanced.html#ADVANCED'>More
|
||||
Mini-XML Programming Techniques</a>", shows additional
|
||||
ways to use the Mini-XML library.</li>
|
||||
|
||||
<li>Chapter 4, "<a href='mxmldoc.html#MXMLDOC'>Using the
|
||||
mxmldoc Utility</a>", describes how to use the
|
||||
<tt>mxmldoc(1)</tt> program to generate software
|
||||
documentation.</li>
|
||||
|
||||
<li>Appendix A, "<a href='license.html#LICENSE'>GNU
|
||||
Library General Public License</a>", provides the terms
|
||||
and conditions for using and distributing Mini-XML.</li>
|
||||
|
||||
<li>Appendix B, "<a
|
||||
href='relnotes.html#RELNOTES'>Release Notes</a>", lists
|
||||
the changes in each release of Mini-XML.</li>
|
||||
|
||||
<li>Appendix C, "<a href='refapp.html#REFERENCE'>Library
|
||||
Reference</a>", contains a complete reference for
|
||||
Mini-XML, generated by <tt>mxmldoc</tt>.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- NEED 4in -->
|
||||
<h2>Notation Conventions</h2>
|
||||
|
||||
<p>Various font and syntax conventions are used in this guide.
|
||||
Examples and their meanings and uses are explained below:</p>
|
||||
|
||||
<center><table width='80%'>
|
||||
<tr>
|
||||
<th>Example</th>
|
||||
<td> </td>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr><td colspan='3'> </td></tr>
|
||||
<tr valign='top'>
|
||||
<td><code>lpstat</code><br />
|
||||
<code>lpstat(1)</code></td>
|
||||
|
||||
<td> </td>
|
||||
|
||||
<td>The names of commands; the first mention of a command or
|
||||
function in a chapter is followed by a manual page section
|
||||
number.</td>
|
||||
</tr>
|
||||
<tr><td colspan='3'> </td></tr>
|
||||
<tr valign='top'>
|
||||
<td><var>/var</var><br />
|
||||
<var>/usr/share/cups/data/testprint.ps</var></td>
|
||||
|
||||
<td> </td>
|
||||
|
||||
<td>File and directory names.</td>
|
||||
</tr>
|
||||
<tr><td colspan='3'> </td></tr>
|
||||
<tr valign='top'>
|
||||
<td nowrap><tt>Request ID is Printer-123</tt></td>
|
||||
|
||||
<td> </td>
|
||||
|
||||
<td>Screen output.</td>
|
||||
</tr>
|
||||
<tr><td colspan='3'> </td></tr>
|
||||
<tr valign='top'>
|
||||
<td nowrap><kbd>lp -d printer filename ENTER</kbd></td>
|
||||
|
||||
<td> </td>
|
||||
|
||||
<td>Literal user input; special keys like <kbd>ENTER</kbd> are
|
||||
in ALL CAPS.</td>
|
||||
</tr>
|
||||
<tr><td colspan='3'> </td></tr>
|
||||
<tr valign='top'>
|
||||
<td>12.3</td>
|
||||
|
||||
<td> </td>
|
||||
|
||||
<td>Numbers in the text are written using the period (.) to indicate
|
||||
the decimal point.</td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<!-- NEED 4in -->
|
||||
<h2>Abbreviations</h2>
|
||||
|
||||
<p>The following abbreviations are used throughout this
|
||||
manual:</p>
|
||||
|
||||
<blockquote>
|
||||
<dl>
|
||||
|
||||
<dt>Gb</dt>
|
||||
<dd>Gigabytes, or 1073741824 bytes<br /> </dd>
|
||||
|
||||
<dt>kb</dt>
|
||||
<dd>Kilobytes, or 1024 bytes<br /> </dd>
|
||||
|
||||
<dt>Mb</dt>
|
||||
<dd>Megabytes, or 1048576 bytes<br /> </dd>
|
||||
|
||||
<dt>UTF-8, UTF-16</dt>
|
||||
<dd>Unicode Transformation Format, 8-bit or 16-bit<br /> </dd>
|
||||
|
||||
<dt>W3C</dt>
|
||||
<dd>World Wide Web Consortium<br /> </dd>
|
||||
|
||||
<dt>XML</dt>
|
||||
<dd>Extensible Markup Language<br /> </dd>
|
||||
|
||||
</dl>
|
||||
</blockquote>
|
||||
|
||||
<h2>Other References</h2>
|
||||
|
||||
<blockquote>
|
||||
<dl>
|
||||
|
||||
<dt>The Unicode Standard, Version 4.0, Addison-Wesley,
|
||||
ISBN 0-321-18578-1</dt>
|
||||
|
||||
<dd>The definition of the Unicode character set which is
|
||||
used for XML.<br /> </dd>
|
||||
|
||||
<dt><a
|
||||
href='http://www.w3.org/TR/2004/REC-xml-20040204/'>Extensible
|
||||
Markup Language (XML) 1.0 (Third Edition)</a></dt>
|
||||
|
||||
<dd>The XML specification from the World Wide Web
|
||||
Consortium (W3C)<br /> </dd>
|
||||
|
||||
</dl>
|
||||
</blockquote>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
BIN
doc/mxml.pdf
BIN
doc/mxml.pdf
Binary file not shown.
@ -1,13 +1,80 @@
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<h1 align='right'><a name='MXMLDOC'>3 - Using the mxmldoc
|
||||
<h1 align='right'><a name='MXMLDOC'>4 - Using the mxmldoc
|
||||
Utility</a></h1>
|
||||
|
||||
<p>This chapter describes how to use the <tt>mxmldoc(1)</tt>
|
||||
utility that comes with Mini-XML to automatically generate
|
||||
documentation for your programs.</p>
|
||||
|
||||
<h2>The Basics</h2>
|
||||
|
||||
<p>The <tt>mxmldoc</tt> utility scans C and C++ source and
|
||||
header files and produces an XML file describing the library
|
||||
interface and an XHTML file providing a human-readable reference
|
||||
to the code.</p>
|
||||
|
||||
<h2>XML Schema</h2>
|
||||
|
||||
<p>The following poor-man's schema describes the format of the
|
||||
XML files produced by <tt>mxmldoc</tt>:
|
||||
|
||||
<pre>
|
||||
<?xml version="1.0"?>
|
||||
<namespace name=""> [optional...]
|
||||
<constant name="">
|
||||
<description>descriptive text</description>
|
||||
</constant>
|
||||
|
||||
<enumeration name="">
|
||||
<constant name="">...</constant>
|
||||
</enumeration>
|
||||
|
||||
<typedef name="">
|
||||
<description>descriptive text</description>
|
||||
<type>type string</type>
|
||||
</typedef>
|
||||
|
||||
<function name="" scope="">
|
||||
<description>descriptive text</description>
|
||||
<argument name="" direction="I|O|IO" default="">
|
||||
<description>descriptive text</description>
|
||||
<type>type string</type>
|
||||
</argument>
|
||||
<returnvalue>
|
||||
<description>descriptive text</description>
|
||||
<type>type string</type>
|
||||
</returnvalue>
|
||||
<seealso>function names separated by spaces</seealso>
|
||||
</function>
|
||||
|
||||
<variable name="" scope="">
|
||||
<description>descriptive text</description>
|
||||
<type>type string</type>
|
||||
</variable>
|
||||
|
||||
<struct name="">
|
||||
<description>descriptive text</description>
|
||||
<variable name="">...</variable>
|
||||
<function name="">...</function>
|
||||
</struct>
|
||||
|
||||
<union name="">
|
||||
<description>descriptive text</description>
|
||||
<variable name="">...</variable>
|
||||
</union>
|
||||
|
||||
<class name="" parent="">
|
||||
<description>descriptive text</description>
|
||||
<class name="">...</class>
|
||||
<enumeration name="">...</enumeration>
|
||||
<function name="">...</function>
|
||||
<struct name="">...</struct>
|
||||
<variable name="">...</variable>
|
||||
</class>
|
||||
</namespace>
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
161
doc/mxmldoc.xsd
Normal file
161
doc/mxmldoc.xsd
Normal file
@ -0,0 +1,161 @@
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
Mini-XML 2.0 documentation schema for mxmldoc output.
|
||||
Copyright 2003-2004 by Michael Sweet.
|
||||
|
||||
This program 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, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<!-- basic element definitions -->
|
||||
<xsd:element name="argument" type="argumentType"/>
|
||||
<xsd:element name="class" type="classType"/>
|
||||
<xsd:element name="constant" type="constantType"/>
|
||||
<xsd:element name="description" type="xsd:string"/>
|
||||
<xsd:element name="enumeration" type="enumerationType"/>
|
||||
<xsd:element name="function" type="functionType"/>
|
||||
<xsd:element name="namespace" type="namespaceType"/>
|
||||
<xsd:element name="returnvalue" type="returnvalueType"/>
|
||||
<xsd:element name="seealso" type="xsd:string"/>
|
||||
<xsd:element name="struct" type="structType"/>
|
||||
<xsd:element name="typedef" type="typedefType"/>
|
||||
<xsd:element name="type" type="xsd:string"/>
|
||||
<xsd:element name="union" type="unionType"/>
|
||||
<xsd:element name="variable" type="variableType"/>
|
||||
|
||||
<!-- descriptions of complex elements -->
|
||||
<xsd:complexType name="argumentType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="type" minOccurs="1" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="default" type="xsd:string" use="optional"/>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
<xsd:attribute name="direction" type="direction" use="optional" default="I"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="classType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="class" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="enumeration" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="function" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="struct" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="union" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
<xsd:attribute name="parent" type="xsd:string" use="optional"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="constantType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="enumerationType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="constant" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="functionType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="argument" minOccurs="1" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="returnvalue" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="seealso" minOccurs="0" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
<xsd:attribute name="scope" type="scope" use="optional"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="namespaceType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="class" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="enumeration" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="function" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="struct" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="union" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="returnvalueType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="type" minOccurs="1" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="structType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="function" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="typedefType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="type" minOccurs="1" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="unionType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="variableType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="description" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element ref="type" minOccurs="1" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="identifier" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<!-- data types -->
|
||||
<xsd:simpleType name="direction">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="I"/>
|
||||
<xsd:enumeration value="O"/>
|
||||
<xsd:enumeration value="IO"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="identifier">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:pattern value="[a-zA-Z_][a-zA-Z_0-9]*"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<xsd:simpleType name="scope">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value=""/>
|
||||
<xsd:enumeration value="private"/>
|
||||
<xsd:enumeration value="protected"/>
|
||||
<xsd:enumeration value="public"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
</xsd:schema>
|
@ -7,11 +7,13 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li>New programmers manual.</li>
|
||||
|
||||
<li>Changed the whitespace callback interface to return
|
||||
strings instead of a single character, allowing for
|
||||
greater control over the formatting of XML files
|
||||
written using Mini-XML. THIS CHANGE WILL REQUIRE
|
||||
CHANGES TO YOUR CODE IF YOU USE WHITESPACE CALLBACKS.</li>
|
||||
greater control over the formatting of XML files written
|
||||
using Mini-XML. THIS CHANGE WILL REQUIRE CHANGES TO
|
||||
YOUR 1.x CODE IF YOU USE WHITESPACE CALLBACKS.</li>
|
||||
|
||||
<li>The mxmldoc utility is now capable of documenting C++
|
||||
classes, functions, and structures, and correctly
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-attr.c,v 1.7 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-attr.c,v 1.8 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Attribute support code for mini-XML, a small XML-like file parsing library.
|
||||
* Attribute support code for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -172,5 +172,5 @@ mxmlElementSetAttr(mxml_node_t *node, /* I - Element node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-attr.c,v 1.7 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-attr.c,v 1.8 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-entity.c,v 1.2 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-entity.c,v 1.3 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Character entity support code for mini-XML, a small XML-like
|
||||
* Character entity support code for Mini-XML, a small XML-like
|
||||
* file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
@ -364,5 +364,5 @@ mxmlEntityGetValue(const char *name) /* I - Entity name */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-entity.c,v 1.2 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-entity.c,v 1.3 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-file.c,v 1.29 2004/05/01 15:20:04 mike Exp $"
|
||||
* "$Id: mxml-file.c,v 1.30 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* File loading code for mini-XML, a small XML-like file parsing library.
|
||||
* File loading code for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -1734,5 +1734,5 @@ mxml_write_ws(mxml_node_t *node, /* I - Current node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-file.c,v 1.29 2004/05/01 15:20:04 mike Exp $".
|
||||
* End of "$Id: mxml-file.c,v 1.30 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-node.c,v 1.12 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-node.c,v 1.13 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Node support code for mini-XML, a small XML-like file parsing library.
|
||||
* Node support code for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -632,5 +632,5 @@ mxml_new(mxml_node_t *parent, /* I - Parent node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-node.c,v 1.12 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-node.c,v 1.13 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-private.c,v 1.3 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-private.c,v 1.4 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Private functions for mini-XML, a small XML-like file parsing library.
|
||||
* Private functions for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -128,5 +128,5 @@ mxml_real_cb(mxml_node_t *node) /* I - Current node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-private.c,v 1.3 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-private.c,v 1.4 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-search.c,v 1.9 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-search.c,v 1.10 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Search/navigation functions for mini-XML, a small XML-like file
|
||||
* Search/navigation functions for Mini-XML, a small XML-like file
|
||||
* parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
@ -195,5 +195,5 @@ mxmlWalkPrev(mxml_node_t *node, /* I - Current node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-search.c,v 1.9 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-search.c,v 1.10 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-set.c,v 1.2 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-set.c,v 1.3 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Node set functions for mini-XML, a small XML-like file parsing library.
|
||||
* Node set functions for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -220,5 +220,5 @@ mxmlSetTextf(mxml_node_t *node, /* I - Node to set */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-set.c,v 1.2 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-set.c,v 1.3 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml-string.c,v 1.3 2004/04/06 01:47:20 mike Exp $"
|
||||
* "$Id: mxml-string.c,v 1.4 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* String functions for mini-XML, a small XML-like file parsing library.
|
||||
* String functions for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -373,5 +373,5 @@ mxml_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-string.c,v 1.3 2004/04/06 01:47:20 mike Exp $".
|
||||
* End of "$Id: mxml-string.c,v 1.4 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
6
mxml.h
6
mxml.h
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxml.h,v 1.18 2004/05/01 15:20:04 mike Exp $"
|
||||
* "$Id: mxml.h,v 1.19 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Header file for mini-XML, a small XML-like file parsing library.
|
||||
* Header file for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -206,5 +206,5 @@ extern mxml_type_t mxml_real_cb(mxml_node_t *node);
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml.h,v 1.18 2004/05/01 15:20:04 mike Exp $".
|
||||
* End of "$Id: mxml.h,v 1.19 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
18
mxml.list.in
18
mxml.list.in
@ -1,7 +1,7 @@
|
||||
#
|
||||
# "$Id: mxml.list.in,v 1.12 2004/04/29 12:29:17 mike Exp $"
|
||||
# "$Id: mxml.list.in,v 1.13 2004/05/02 16:04:40 mike Exp $"
|
||||
#
|
||||
# EPM software list file for mini-XML, a small XML-like file parsing library.
|
||||
# EPM software list file for Mini-XML, a small XML-like file parsing library.
|
||||
#
|
||||
# Copyright 2003-2004 by Michael Sweet.
|
||||
#
|
||||
@ -32,7 +32,7 @@ $srcdir=@srcdir@
|
||||
%vendor Michael Sweet
|
||||
%license ${srcdir}/COPYING
|
||||
%readme ${srcdir}/README
|
||||
%version 2.0
|
||||
%version @VERSION@
|
||||
|
||||
%description <<EOF
|
||||
Mini-XML is a small XML parsing library that you can use to read
|
||||
@ -56,9 +56,7 @@ 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, nor does it support character entities other than
|
||||
those required by the XML specification. Also, since Mini-XML
|
||||
does not support the UTF-16 encoding, it is technically not a
|
||||
conforming XML consumer/client.
|
||||
those required by the XML specification.
|
||||
EOF
|
||||
|
||||
# Manpage extensions...
|
||||
@ -76,11 +74,15 @@ f 0444 root sys ${includedir}/mxml.h mxml.h
|
||||
# Libraries
|
||||
f 0444 root sys ${libdir}/libmxml.a libmxml.a
|
||||
|
||||
# pkg-config info
|
||||
f 0444 root sys $(libdir)/pkgconfig/mxml.pc mxml.pc
|
||||
|
||||
# Documentation
|
||||
f 0444 root sys ${docdir}/README $srcdir/README
|
||||
f 0444 root sys ${docdir}/COPYING $srcdir/COPYING
|
||||
f 0444 root sys ${docdir}/CHANGES $srcdir/CHANGES
|
||||
f 0444 root sys ${docdir}/documentation.html $srcdir/documentation.html
|
||||
f 0444 root sys ${docdir}/mxml.html $srcdir/doc/mxml.html
|
||||
f 0444 root sys ${docdir}/mxml.pdf $srcdir/doc/mxml.pdf
|
||||
|
||||
# Man pages
|
||||
f 0444 root sys ${mandir}/cat1/mxmldoc.$CAT1EXT $srcdir/mxmldoc.$CAT1EXT
|
||||
@ -89,5 +91,5 @@ f 0444 root sys ${mandir}/cat3/mxml.$CAT3EXT $srcdir/mxml.$CAT3EXT
|
||||
f 0444 root sys ${mandir}/man3/mxml.$MAN3EXT $srcdir/mxml.man
|
||||
|
||||
#
|
||||
# End of "$Id: mxml.list.in,v 1.12 2004/04/29 12:29:17 mike Exp $".
|
||||
# End of "$Id: mxml.list.in,v 1.13 2004/05/02 16:04:40 mike Exp $".
|
||||
#
|
||||
|
24
mxml.spec
24
mxml.spec
@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id: mxml.spec,v 1.10 2004/04/29 12:29:17 mike Exp $"
|
||||
# "$Id: mxml.spec,v 1.11 2004/05/02 16:04:40 mike Exp $"
|
||||
#
|
||||
# RPM "spec" file for mini-XML, a small XML-like file parsing library.
|
||||
# RPM "spec" file for Mini-XML, a small XML-like file parsing library.
|
||||
#
|
||||
# Copyright 2003 by Michael Sweet.
|
||||
# Copyright 2003-2004 by Michael Sweet.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
@ -18,14 +18,14 @@
|
||||
|
||||
Summary: Miniature XML development library
|
||||
Name: mxml
|
||||
Version: 2.0
|
||||
Version: 2.0rc1
|
||||
Release: 1
|
||||
Copyright: GPL
|
||||
Group: Development/Libraries
|
||||
Source: http://www.easysw.com/~mike/mxml/mxml-%{version}.tar.gz
|
||||
Url: http://www.easysw.com/~mike/mxml/
|
||||
Packager: Mike Sweet <mike@easysw.com>
|
||||
Vendor: Mike Sweet
|
||||
Packager: Michael Sweet <mxml@easysw.com>
|
||||
Vendor: Michael Sweet
|
||||
|
||||
# Use buildroot so as not to disturb the version already installed
|
||||
BuildRoot: /var/tmp/%{name}-root
|
||||
@ -52,9 +52,7 @@ 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, nor does it support character entities other than
|
||||
those required by the XML specification. Also, since Mini-XML
|
||||
does not support the UTF-16 encoding, it is technically not a
|
||||
conforming XML consumer/client.
|
||||
those required by the XML specification.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
@ -80,9 +78,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir /usr/bin
|
||||
/usr/bin/*
|
||||
%dir /usr/include
|
||||
/usr/include/*
|
||||
/usr/include/mxml.h
|
||||
%dir /usr/lib
|
||||
/usr/lib/*
|
||||
/usr/lib/libmxml.a
|
||||
%dir /usr/lib/pkgconfig
|
||||
/usr/lib/pkgconfig/mxml.pc
|
||||
%dir /usr/share/doc/mxml
|
||||
/usr/share/doc/mxml/*
|
||||
%dir /usr/share/man/cat1
|
||||
@ -95,5 +95,5 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/man/man3/*
|
||||
|
||||
#
|
||||
# End of "$Id: mxml.spec,v 1.10 2004/04/29 12:29:17 mike Exp $".
|
||||
# End of "$Id: mxml.spec,v 1.11 2004/05/02 16:04:40 mike Exp $".
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: mxmldoc.c,v 1.34 2004/05/01 22:45:34 mike Exp $"
|
||||
* "$Id: mxmldoc.c,v 1.35 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Documentation generator using mini-XML, a small XML-like file parsing
|
||||
* Documentation generator using Mini-XML, a small XML-like file parsing
|
||||
* library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
@ -2708,5 +2708,5 @@ ws_cb(mxml_node_t *node, /* I - Element node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxmldoc.c,v 1.34 2004/05/01 22:45:34 mike Exp $".
|
||||
* End of "$Id: mxmldoc.c,v 1.35 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id: testmxml.c,v 1.15 2004/05/01 15:20:05 mike Exp $"
|
||||
* "$Id: testmxml.c,v 1.16 2004/05/02 16:04:40 mike Exp $"
|
||||
*
|
||||
* Test program for mini-XML, a small XML-like file parsing library.
|
||||
* Test program for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2004 by Michael Sweet.
|
||||
*
|
||||
@ -431,5 +431,5 @@ whitespace_cb(mxml_node_t *node, /* I - Element node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testmxml.c,v 1.15 2004/05/01 15:20:05 mike Exp $".
|
||||
* End of "$Id: testmxml.c,v 1.16 2004/05/02 16:04:40 mike Exp $".
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user