Commit aaefc5c0 authored by Michael R Sweet's avatar Michael R Sweet

Rename mxmlFindValue to mxmlFindPath.

Rename mxmlGetPrevious to mxmlGetPrevSibling.

Rename mxmlGetNext to mxmlGetNextSibling.

Update documentation.
parent a9012172
CHANGES - 2011-01-01
CHANGES - 2011-01-02
--------------------
CHANGES IN Mini-XML 2.7
......@@ -8,7 +8,7 @@ CHANGES IN Mini-XML 2.7
header to preserve source compatibility (STR #118)
- Updated the source headers to reference the Mini-XML license and its
exceptions to the LGPL2 (STR #108)
- Added a new mxmlFindValue() function to find the value node of a
- Added a new mxmlFindPath() function to find the value node of a
named element (STR #110)
- Building a static version of the library did not work on Windows
(STR #112)
......
......@@ -6,21 +6,21 @@ The Mini-XML library and included programs are provided under the
terms of the GNU Library General Public License version 2 (LGPL2)
with the following exceptions:
1. Static linking of applications to the Mini-XML library
does not constitute a derivative work and does not require
the author to provide source code for the application, use
the shared Mini-XML libraries, or link their applications
against a user-supplied version of Mini-XML.
If you link the application to a modified version of
Mini-XML, then the changes to Mini-XML must be provided
under the terms of the LGPL2 in sections 1, 2, and 4.
2. You do not have to provide a copy of the Mini-XML license
with programs that are linked to the Mini-XML library, nor
do you have to identify the Mini-XML license in your
program or documentation as required by section 6 of the
LGPL2.
1. Static linking of applications to the Mini-XML library
does not constitute a derivative work and does not require
the author to provide source code for the application, use
the shared Mini-XML libraries, or link their applications
against a user-supplied version of Mini-XML.
If you link the application to a modified version of
Mini-XML, then the changes to Mini-XML must be provided
under the terms of the LGPL2 in sections 1, 2, and 4.
2. You do not have to provide a copy of the Mini-XML license
with programs that are linked to the Mini-XML library, nor
do you have to identify the Mini-XML license in your
program or documentation as required by section 6 of the
LGPL2.
GNU LIBRARY GENERAL PUBLIC LICENSE
......
......@@ -3,7 +3,7 @@
#
# Makefile for Mini-XML, a small XML-like file parsing library.
#
# Copyright 2003-2010 by Michael R Sweet.
# Copyright 2003-2011 by Michael R Sweet.
#
# These coded instructions, statements, and computer programs are the
# property of Michael R Sweet and are protected by Federal copyright
......@@ -69,9 +69,11 @@ INSTALL_SCRIPT = $(INSTALL) -m 755
# Rules...
#
.SILENT:
.SUFFIXES: .c .man .o
.c.o:
$(CC) $(CFLAGS) -c $<
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
#
......@@ -101,6 +103,7 @@ all: Makefile config.h $(TARGETS)
#
clean:
echo Cleaning build files...
$(RM) $(OBJS) $(TARGETS)
$(RM) mxmldoc-static libmxml.a
......@@ -110,6 +113,7 @@ clean:
#
distclean: clean
echo Cleaning distribution files...
$(RM) config.cache config.log config.status
$(RM) Makefile config.h
$(RM) -r autom4te*.cache
......@@ -123,9 +127,11 @@ distclean: clean
.PHONY: clang clang-changes
clang:
echo Doing static code analysis of all code using CLANG...
$(RM) -r clang
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
clang-changes:
echo Doing static code analysis of changed code using CLANG...
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
......@@ -134,41 +140,50 @@ clang-changes:
#
install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
echo Installing mxmldoc in $(BUILDROOT)$(bindir)...
$(INSTALL_DIR) $(BUILDROOT)$(bindir)
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
echo Installing documentation in $(BUILDROOT)$(docdir)...
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
for file in $(DOCFILES); do \
$(INSTALL_MAN) $$file $(BUILDROOT)$(docdir); \
done
echo Installing header files in $(BUILDROOT)$(includedir)...
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
$(INSTALL_DATA) mxml.h $(BUILDROOT)$(includedir)
echo Installing pkgconfig files in $(BUILDROOT)$(libdir)/pkgconfig...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
echo Installing man pages in $(BUILDROOT)$(mandir)...
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1
$(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.1
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
$(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.3
install-libmxml.a:
echo Installing libmxml.a to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml.a
install-libmxml.so.1.4:
install-libmxml.so.1.5:
echo Installing libmxml.so to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.so.1.4 $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.so.1.5 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.so.1.4 $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.so.1.5 $(BUILDROOT)$(libdir)/libmxml.so
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(LN) libmxml.so.1.4 $(BUILDROOT)$(libdir)/libmxml.so.1
$(LN) libmxml.so.1.5 $(BUILDROOT)$(libdir)/libmxml.so.1
install-libmxml.sl.1:
echo Installing libmxml.sl to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.sl.1 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.sl.1 $(BUILDROOT)$(libdir)/libmxml.sl
install-libmxml.1.dylib:
echo Installing libmxml.dylib to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.1.dylib $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
......@@ -180,35 +195,45 @@ install-libmxml.1.dylib:
#
uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
echo Uninstalling mxmldoc from $(BUILDROOT)$(bindir)...
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
echo Uninstalling documentation from $(BUILDROOT)$(docdir)...
$(RM) -r $(BUILDROOT)$(docdir)
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
$(RM) $(BUILDROOT)$(includedir)/mxml.h
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
echo Uninstalling man pages from $(BUILDROOT)$(mandir)...
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.1
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.3
uninstall-libmxml.a:
echo Uninstalling libmxml.a from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
uninstall-libmxml.so.1.4:
uninstall-libmxml.so.1.5:
echo Uninstalling libmxml.so from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.4
uninstall-libmxml.sl.1:
echo Uninstalling libmxml.sl from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl.1
uninstall-libmxml.1.dylib:
echo Uninstalling libmxml.dylib from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
$(RM) $(BUILDROOT)$(libdir)/libmxml.1.dylib
#
# Make packages using EPM (http://www.easysw.com/epm/)
# Make packages using EPM (http://www.epmhome.org/)
#
epm: all
echo Creating distribution packages...
epm --output-dir dist -v -f native mxml
epm --output-dir dist -v -f portable mxml
......@@ -218,6 +243,7 @@ epm: all
#
Makefile: configure Makefile.in
echo Updating makefile...
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
......@@ -228,6 +254,7 @@ Makefile: configure Makefile.in
config.h: configure config.h.in
echo Updating config.h...
autoconf
if test -f config.status; then \
./config.status --recheck; \
......@@ -238,11 +265,24 @@ config.h: configure config.h.in
touch config.h
#
# Figure out lines-of-code...
#
.PHONY: sloc
sloc:
echo "libmxml: \c"
sloccount $(LIBOBJS:.o=.c) mxml-private.c mxml.h 2>/dev/null | \
grep "Total Physical" | awk '{print $$9}'
#
# libmxml.a
#
libmxml.a: $(LIBOBJS)
echo Creating $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
......@@ -252,14 +292,15 @@ mxml-entity.o mxml-file.o mxml-private.o: mxml-private.h
#
# libmxml.so.1.4
# libmxml.so.1.5
#
libmxml.so.1.4: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.so.1.4 $(LIBOBJS)
libmxml.so.1.5: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmxml.so.1.5 $(LIBOBJS)
$(RM) libmxml.so libmxml.so.1
$(LN) libmxml.so.1.4 libmxml.so
$(LN) libmxml.so.1.4 libmxml.so.1
$(LN) libmxml.so.1.5 libmxml.so
$(LN) libmxml.so.1.5 libmxml.so.1
#
......@@ -267,6 +308,7 @@ libmxml.so.1.4: $(LIBOBJS)
#
libmxml.sl.1: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmxml.sl.1 $(LIBOBJS)
$(RM) libmxml.sl
$(LN) libmxml.sl.1 libmxml.sl
......@@ -277,9 +319,10 @@ libmxml.sl.1: $(LIBOBJS)
#
libmxml.1.dylib: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmxml.1.dylib \
-install_name $(libdir)/libmxml.dylib \
-current_version 1.4.0 \
-current_version 1.5.0 \
-compatibility_version 1.0.0 \
$(LIBOBJS)
$(RM) libmxml.dylib
......@@ -291,9 +334,11 @@ libmxml.1.dylib: $(LIBOBJS)
#
mxmldoc: $(LIBMXML) mxmldoc.o
echo Linking $@...
$(CC) -L. $(LDFLAGS) -o $@ mxmldoc.o -lmxml $(LIBS)
mxmldoc-static: libmxml.a mxmldoc.o
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a $(LIBS)
mxmldoc.o: mxml.h
......@@ -304,6 +349,7 @@ mxmldoc.o: mxml.h
#
testmxml: libmxml.a testmxml.o
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a $(LIBS)
@echo Testing library...
./testmxml test.xml >temp1.xml 2>temp1s.xml
......@@ -335,6 +381,7 @@ testmxml.o: mxml.h
#
mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
echo Generating API documentation...
$(RM) mxml.xml
./mxmldoc-static --header doc/reference.heading mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
if test "x`uname`" = xDarwin; then \
......@@ -351,6 +398,7 @@ mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
fi
valgrind: mxmldoc-static
echo Doing dynamic code analysis using Valgrind...
$(RM) valgrind.xml
valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \
valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \
......@@ -362,6 +410,7 @@ valgrind: mxmldoc-static
#
doc/mxml.man: mxmldoc-static mxml.xml
echo "Generating mxml(3) man page..."
$(RM) doc/mxml.man
./mxmldoc-static --man mxml --title "Mini-XML API" \
--intro doc/intro.man --footer doc/footer.man \
......
README - 2010-11-08
README - 2011-01-02
-------------------
......@@ -133,7 +133,7 @@ DOCUMENTATION
/* Find the first "a" element with "href" to a URL */
node = mxmlFindElement(tree, tree, "a", "href",
"http://www.easysw.com/~mike/mxml/",
"http://www.minixml.org/",
MXML_DESCEND);
/* Find the first element with a "src" attribute*/
......@@ -156,11 +156,25 @@ DOCUMENTATION
... do something ...
}
The "mxmlFindValue()" function finds the (first) value node under a specific
The "mxmlFindPath()" function finds the (first) value node under a specific
element using a "path":
mxml_node_t *value = mxmlFindValue(tree, "path/to/*/foo/bar");
mxml_node_t *value = mxmlFindPath(tree, "path/to/*/foo/bar");
The "mxmlGetInteger()", "mxmlGetOpaque()", "mxmlGetReal()", and
"mxmlGetText()" functions retrieve the value from a node:
mxml_node_t *node;
int intvalue = mxmlGetInteger(node);
const char *opaquevalue = mxmlGetOpaque(node);
double realvalue = mxmlGetReal(node);
int whitespacevalue;
const char *textvalue = mxmlGetText(node, &whitespacevalue);
Finally, 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:
......@@ -178,5 +192,5 @@ GETTING HELP AND REPORTING PROBLEMS
LEGAL STUFF
The Mini-XML library is Copyright 2003-2010 by Michael Sweet. License terms
The Mini-XML library is Copyright 2003-2011 by Michael Sweet. License terms
are described in the file "COPYING".
......@@ -3,7 +3,7 @@ dnl "$Id$"
dnl
dnl Configuration script for Mini-XML, a small XML-like file parsing library.
dnl
dnl Copyright 2003-2010 by Michael R Sweet.
dnl Copyright 2003-2011 by Michael R Sweet.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Michael R Sweet and are protected by Federal copyright
......@@ -171,7 +171,7 @@ if test x$enable_shared != xno; then
case "$uname" in
SunOS* | UNIX_S*)
AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4"
LIBMXML="libmxml.so.1.5"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)"
LDFLAGS="$LDFLAGS -R\$(libdir)"
......@@ -187,14 +187,14 @@ if test x$enable_shared != xno; then
IRIX)
AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4"
LIBMXML="libmxml.so.1.5"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU)
AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4"
LIBMXML="libmxml.so.1.5"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
......@@ -202,7 +202,7 @@ if test x$enable_shared != xno; then
*BSD*)
AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4"
LIBMXML="libmxml.so.1.5"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"
......
......@@ -64,7 +64,7 @@ child nodes:</p>
type = mxmlElementGetAttr(node, "type");
if (type == NULL)
type = node->value.element.name;
type = mxmlGetElement(node);
if (!strcmp(type, "integer"))
return (MXML_INTEGER);
......@@ -125,7 +125,7 @@ text editor:</p>
* just common HTML elements...
*/
name = node->value.element.name;
name = mxmlGetElement(node);
if (!strcmp(name, "html") ||
!strcmp(name, "head") ||
......@@ -243,10 +243,10 @@ following:</p>
*/
if (sscanf(data, "%u-%u-%uT%u:%u:%uZ",
&(dt->year), &(dt->month),
&(dt->day), &(dt->hour),
&(dt->minute),
&(dt->second)) != 6)
&amp;(dt->year), &amp;(dt->month),
&amp;(dt->day), &amp;(dt->hour),
&amp;(dt->minute),
&amp;(dt->second)) != 6)
{
/*
* Unable to read numbers, free the data
......@@ -296,8 +296,7 @@ following:</p>
* function pointers...
*/
node->value.custom.data = dt;
node->value.custom.destroy = free;
mxmlSetCustom(node, data, destroy);
/*
* Return with no errors...
......@@ -314,6 +313,7 @@ allocated custom data for the node and a pointer to a destructor
function which will free the custom data when the node is
deleted.</p>
<!-- NEED 15 -->
<p>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:</p>
......@@ -326,7 +326,7 @@ save callback could be used for our ISO date/time type:</p>
iso_date_time_t *dt;
dt = (iso_date_time_t *)node->custom.data;
dt = (iso_date_time_t *)mxmlGetCustom(node);
snprintf(data, sizeof(data),
"%04u-%02u-%02uT%02u:%02u:%02uZ",
......@@ -404,9 +404,8 @@ an index is approximately equal to walking the XML document
tree. Nodes in the index are sorted by element name and
attribute value.</p>
<p>Indices are stored in <a
href='#mxml_index_t'><tt>mxml_index_t</tt></a> structures. The
<a href='#mxmlIndexNew'><tt>mxmlIndexNew()</tt></a> function
<p>Indices are stored in <a href='#mxml_index_t'><tt>mxml_index_t</tt></a>
structures. The <a href='#mxmlIndexNew'><tt>mxmlIndexNew()</tt></a> function
creates a new index:</p>
<pre>
......@@ -568,7 +567,7 @@ directives like <tt>&lt;?xml ... ?&gt;</tt> and <tt>&lt;!DOCTYPE ... &gt;</tt>
* Retain headings and titles...
*/
char *name = node->value.element.name;
char *name = mxmlGetElement(node);
if (!strcmp(name, "html") ||
!strcmp(name, "head") ||
......@@ -584,15 +583,17 @@ directives like <tt>&lt;?xml ... ?&gt;</tt> and <tt>&lt;!DOCTYPE ... &gt;</tt>
}
else if (event == MXML_SAX_DIRECTIVE)
mxmlRetain(node);
else if (event == MXML_SAX_DATA &amp;&amp;
node->parent->ref_count > 1)
else if (event == MXML_SAX_DATA)
{
/*
* If the parent was retained, then retain
* this data node as well.
*/
if (mxmlGetRefCount(mxmlGetParent(node)) > 1)
{
/*
* If the parent was retained, then retain
* this data node as well.
*/
mxmlRetain(node);
mxmlRetain(node);
}
}
}
</pre>
......@@ -622,9 +623,9 @@ title and headings in the document would look like:</p>
if (body)
{
for (heading = body->child;
for (heading = mxmlGetFirstChild(body);
heading;
heading = heading->next)
heading = mxmlGetNextSibling(heading))
print_children(heading);
}
</pre>
......
This diff is collapsed.
......@@ -18,7 +18,7 @@ as do most vendors' ANSI C compilers) and a "make" program.</p>
<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
<li>Supports integer, real, opaque ("CDATA"), and text data types in
"leaf" nodes.</li>
<li>Functions for creating, indexing, and managing trees of data.</li>
......@@ -146,6 +146,29 @@ for (node = mxmlFindElement(tree, tree, "name", NULL,
}
</pre>
<p>The "mxmlFindPath()" function finds the (first) value node under a specific
element using a "path":</p>
<pre class='example'>
mxml_node_t *value = mxmlFindPath(tree, "path/to/*/foo/bar");
</pre>
<p>The "mxmlGetInteger()", "mxmlGetOpaque()", "mxmlGetReal()", and
"mxmlGetText()" functions retrieve the value from a node:</p>
<pre class='example'>
mxml_node_t *node;
int intvalue = mxmlGetInteger(node);
const char *opaquevalue = mxmlGetOpaque(node);
double realvalue = mxmlGetReal(node);
int whitespacevalue;
const char *textvalue = mxmlGetText(node, &amp;whitespacevalue);
</pre>
<p>Finally, once you are done with the XML data, use the
"<a href='#mxmlDelete'>mxmlDelete()</a>" function to recursively free the
memory that is used for a particular node or the entire tree:</p>
......
.SH SEE ALSO
mxmldoc(1), Mini-XML Programmers Manual, http://www.minixml.org/
.SH COPYRIGHT
Copyright 2003-2008 by Michael Sweet.
Copyright 2003-2011 by Michael Sweet.
......@@ -94,7 +94,7 @@ 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>
<a href="http://www.epmhome.org/">http://www.epmhome.org/</a>
</pre>
<p>Use the <tt>make</tt> command with the <kbd>epm</kbd> target
......
......@@ -37,7 +37,7 @@ 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 3,747
complete XML implementation and now stands at a whopping 3,965
lines of code, compared to 103,893 lines of code for libxml2
version 2.6.9.</p>
......
......@@ -19,7 +19,7 @@ preserving the XML data hierarchy.
Supports arbitrary element names, attributes, and attribute
values with no preset limits, just available memory.
.IP \(bu 4
Supports integer, real, opaque ("cdata"), and text data types in
Supports integer, real, opaque ("CDATA"), and text data types in
"leaf" nodes.
.IP \(bu 4
Functions for creating, indexing, and managing trees of data.
......@@ -141,11 +141,27 @@ You can also iterate with the same function:
}
.fi
.PP
To find the value of a specific node in the tree, use the "mxmlFindValue()"
To find the value of a specific node in the tree, use the "mxmlFindPath()"
function:
.nf
mxml_node_t *value = mxmlFindValue(tree, "path/to/*/foo/bar");
mxml_node_t *value = mxmlFindPath(tree, "path/to/*/foo/bar");
.fi
.PP
The "mxmlGetInteger()", "mxmlGetOpaque()", "mxmlGetReal()", and "mxmlGetText()"
functions retrieve the value from a node:
.nf
mxml_node_t *node;
int intvalue = mxmlGetInteger(node);
const char *opaquevalue = mxmlGetOpaque(node);
double realvalue = mxmlGetReal(node);
int whitespacevalue;
const char *textvalue = mxmlGetText(node, &whitespacevalue);
.fi
.PP
Finally, once you are done with the XML data, use the
......
......@@ -9,30 +9,26 @@ License</h1>
the terms of the GNU Library General Public License version 2
(LGPL2) with the following exceptions:</p>
<ol>
<li>Static linking of applications to the Mini-XML
library does not constitute a derivative work and does
not require the author to provide source code for the
application, use the shared Mini-XML libraries, or link
their applications against a user-supplied version of
Mini-XML.
<p><i>If you link the application to a modified version
of Mini-XML, then the changes to Mini-XML must be
provided under the terms of the LGPL2 in sections 1, 2,
and 4.</i></p>
</li>
<li>You do not have to provide a copy of the Mini-XML
license with programs that are linked to the Mini-XML
library, nor do you have to identify the Mini-XML license
in your program or documentation as required by section 6
of the LGPL2.</li>
</ol>
<!-- NEW PAGE -->
<p><b>1.</b> Static linking of applications to the Mini-XML
library does not constitute a derivative work and does
not require the author to provide source code for the
application, use the shared Mini-XML libraries, or link
their applications against a user-supplied version of
Mini-XML.</p>
<p><i>If you link the application to a modified version
of Mini-XML, then the changes to Mini-XML must be
provided under the terms of the LGPL2 in sections 1, 2,
and 4.</i></p>
<p><b>2.</b> You do not have to provide a copy of the Mini-XML
license with programs that are linked to the Mini-XML
library, nor do you have to identify the Mini-XML license
in your program or documentation as required by section 6
of the LGPL2.</p>
<p>&nbsp;</p>
<p align=center><b>GNU LIBRARY GENERAL PUBLIC LICENSE</b></p>
<p align='center'>Version 2, June 1991
<br>Copyright (C) 1991 Free Software Foundation, Inc.
......
This diff is collapsed.
......@@ -88,7 +88,7 @@ to describe the functions, types, and constants in your code.
source files - any names starting with the underscore character (_)
or names that are documented with the <A
HREF="#ATDIRECTIVES">@private@</A> directive are treated as private
and are undocumented.</p>
and are not documented.</p>
<p>Comments appearing directly before a function or type definition
are used to document that function or type. Comments appearing after
......@@ -155,7 +155,7 @@ following special <tt>@name ...@</tt> directive strings:</p>
<li><tt>@since ...@</tt> - flags the item as new since a
particular release. The text following the <tt>@since</tt>
up to the closing <tt>@</tt> is highlighted in the generated
documentation, e.g. <tt>@since CUPS 1.3@</tt>.</li>
documentation, e.g. <tt>@since Mini-XML 2.7@</tt>.</li>
</ul>
......
......@@ -2,8 +2,8 @@
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Mini-XML 2.3 documentation schema for mxmldoc output.
Copyright 2003-2007 by Michael Sweet.
Mini-XML 2.7 documentation schema for mxmldoc output.
Copyright 2003-2011 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
......
......@@ -155,7 +155,7 @@ Reference</h1>
<li><a href="#mxmlEntityGetValue" title="Get the character corresponding to a named entity.">mxmlEntityGetValue</a></li>
<li><a href="#mxmlEntityRemoveCallback" title="Remove a callback.">mxmlEntityRemoveCallback</a></li>
<li><a href="#mxmlFindElement" title="Find the named element.">mxmlFindElement</a></li>
<li><a href="#mxmlFindValue" title="Find a value with the given path.">mxmlFindValue</a></li>
<li><a href="#mxmlFindPath" title="Find a node with the given path.">mxmlFindPath</a></li>
<li><a href="#mxmlGetCDATA" title="Get the value for a CDATA node.">mxmlGetCDATA</a></li>
<li><a href="#mxmlGetCustom" title="Get the value for a custom node.">mxmlGetCustom</a></li>
<li><a href="#mxmlGetElement" title="Get the name for an element node.">mxmlGetElement</a></li>
......@@ -163,11 +163,12 @@ Reference</h1>
<li><a href="#mxmlGetInteger" title="Get the integer value from the specified node or its
first child.">mxmlGetInteger</a></li>
<li><a href="#mxmlGetLastChild" title="Get the last child of an element node.">mxmlGetLastChild</a></li>
<li><a href="#mxmlGetNext" title="Return the node type...">mxmlGetNext</a></li>
<li><a href="#mxmlGetNextSibling" title="Return the node type...">mxmlGetNextSibling</a></li>
<li><a href="#mxmlGetOpaque" title="Get an opaque string value for a node or its first child.">mxmlGetOpaque</a></li>
<li><a href="#mxmlGetParent" title="Get the parent node.">mxmlGetParent</a></li>
<li><a href="#mxmlGetPrevious" title="Get the previous node for the current parent.">mxmlGetPrevious</a></li>
<li><a href="#mxmlGetPrevSibling" title="Get the previous node for the current parent.">mxmlGetPrevSibling</a></li>
<li><a href="#mxmlGetReal" title="Get the real value for a node or its first child.">mxmlGetReal</a></li>
<li><a href="#mxmlGetRefCount" title="Get the current reference (use) count for a node.">mxmlGetRefCount</a></li>
<li><a href="#mxmlGetText" title="Get the text value for a node or its first child.">mxmlGetText</a></li>
<li><a href="#mxmlGetType" title="Get the node type.">mxmlGetType</a></li>
<li><a href="#mxmlGetUserData" title="Get the user data pointer for a node.">mxmlGetUserData</a></li>
......@@ -452,10 +453,10 @@ whether the search descends into child nodes; normally you will use
MXML_DESCEND_FIRST for the initial search and MXML_NO_DESCEND to find
additional direct descendents of the node. The top node argument
constrains the search to a particular node's children.</p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlFindValue">mxmlFindValue</a></h3>
<p class="description">Find a value with the given path.</p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlFindPath">mxmlFindPath</a></h3>
<p class="description">Find a node with the given path.</p>
<p class="code">
<a href="#mxml_node_t">mxml_node_t</a> *mxmlFindValue (<br>
<a href="#mxml_node_t">mxml_node_t</a> *mxmlFindPath (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *top,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *path<br>
);</p>
......@@ -467,17 +468,20 @@ constrains the search to a particular node's children.</p>
<dd class="description">Path to element</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">First value node or NULL</p>
<p class="description">Found node or NULL</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The &quot;path&quot; is a slash-separated list of element names. The name &quot;*&quot; is
considered a wildcard for one or more levels of elements. For example,
&quot;foo/one/two&quot;, &quot;bar/two/one&quot;, &quot;*/one&quot;, and so forth.
&quot;foo/one/two&quot;, &quot;bar/two/one&quot;, &quot;*/one&quot;, and so forth.<br>
<br>
The first child node of the found node is returned if the given node has
children and the first child is a value node.
</p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetCDATA">mxmlGetCDATA</a></h3>
<p class="description">Get the value for a CDATA node.</p>
<p class="code">
char *mxmlGetCDATA (<br>