Rename mxmlFindValue to mxmlFindPath.

Rename mxmlGetPrevious to mxmlGetPrevSibling.

Rename mxmlGetNext to mxmlGetNextSibling.

Update documentation.
pull/193/head
Michael R Sweet 14 years ago
parent a9012172c1
commit aaefc5c07c
  1. 4
      CHANGES
  2. 22
      COPYING
  3. 77
      Makefile.in
  4. 24
      README
  5. 10
      configure.in
  6. 35
      doc/advanced.html
  7. 271
      doc/basics.html
  8. 25
      doc/docset.intro
  9. 2
      doc/footer.man
  10. BIN
      doc/hires/logo.png
  11. 2
      doc/install.html
  12. 2
      doc/intro.html
  13. 22
      doc/intro.man
  14. 44
      doc/license.html
  15. BIN
      doc/logo.opacity
  16. BIN
      doc/logo.png
  17. 407
      doc/mxml.html
  18. 4
      doc/mxmldoc.html
  19. 4
      doc/mxmldoc.xsd
  20. 57
      doc/reference.html
  21. 6
      doc/relnotes.html
  22. 6
      doc/schema.html
  23. 22
      mxml-get.c
  24. 45
      mxml-node.c
  25. 18
      mxml-search.c
  26. 17
      mxml.h
  27. 40
      mxml.xml
  28. 8
      testmxml.c
  29. 19
      vcnet/mxml1.def
  30. 4
      vcnet/mxml1.vcproj

@ -1,4 +1,4 @@
CHANGES - 2011-01-01 CHANGES - 2011-01-02
-------------------- --------------------
CHANGES IN Mini-XML 2.7 CHANGES IN Mini-XML 2.7
@ -8,7 +8,7 @@ CHANGES IN Mini-XML 2.7
header to preserve source compatibility (STR #118) header to preserve source compatibility (STR #118)
- Updated the source headers to reference the Mini-XML license and its - Updated the source headers to reference the Mini-XML license and its
exceptions to the LGPL2 (STR #108) 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) named element (STR #110)
- Building a static version of the library did not work on Windows - Building a static version of the library did not work on Windows
(STR #112) (STR #112)

@ -7,20 +7,20 @@ terms of the GNU Library General Public License version 2 (LGPL2)
with the following exceptions: with the following exceptions:
1. Static linking of applications to the Mini-XML library 1. Static linking of applications to the Mini-XML library
does not constitute a derivative work and does not require does not constitute a derivative work and does not require
the author to provide source code for the application, use the author to provide source code for the application, use
the shared Mini-XML libraries, or link their applications the shared Mini-XML libraries, or link their applications
against a user-supplied version of Mini-XML. against a user-supplied version of Mini-XML.
If you link the application to a modified version of If you link the application to a modified version of
Mini-XML, then the changes to Mini-XML must be provided Mini-XML, then the changes to Mini-XML must be provided
under the terms of the LGPL2 in sections 1, 2, and 4. 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 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 with programs that are linked to the Mini-XML library, nor
do you have to identify the Mini-XML license in your do you have to identify the Mini-XML license in your
program or documentation as required by section 6 of the program or documentation as required by section 6 of the
LGPL2. LGPL2.
GNU LIBRARY GENERAL PUBLIC LICENSE GNU LIBRARY GENERAL PUBLIC LICENSE

@ -3,7 +3,7 @@
# #
# Makefile for Mini-XML, a small XML-like file parsing library. # 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 # These coded instructions, statements, and computer programs are the
# property of Michael R Sweet and are protected by Federal copyright # property of Michael R Sweet and are protected by Federal copyright
@ -69,9 +69,11 @@ INSTALL_SCRIPT = $(INSTALL) -m 755
# Rules... # Rules...
# #
.SILENT:
.SUFFIXES: .c .man .o .SUFFIXES: .c .man .o
.c.o: .c.o:
$(CC) $(CFLAGS) -c $< echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
# #
@ -101,6 +103,7 @@ all: Makefile config.h $(TARGETS)
# #
clean: clean:
echo Cleaning build files...
$(RM) $(OBJS) $(TARGETS) $(RM) $(OBJS) $(TARGETS)
$(RM) mxmldoc-static libmxml.a $(RM) mxmldoc-static libmxml.a
@ -110,6 +113,7 @@ clean:
# #
distclean: clean distclean: clean
echo Cleaning distribution files...
$(RM) config.cache config.log config.status $(RM) config.cache config.log config.status
$(RM) Makefile config.h $(RM) Makefile config.h
$(RM) -r autom4te*.cache $(RM) -r autom4te*.cache
@ -123,9 +127,11 @@ distclean: clean
.PHONY: clang clang-changes .PHONY: clang clang-changes
clang: clang:
echo Doing static code analysis of all code using CLANG...
$(RM) -r clang $(RM) -r clang
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
clang-changes: clang-changes:
echo Doing static code analysis of changed code using CLANG...
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
@ -134,41 +140,50 @@ clang-changes:
# #
install: $(TARGETS) install-$(LIBMXML) install-libmxml.a install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
echo Installing mxmldoc in $(BUILDROOT)$(bindir)...
$(INSTALL_DIR) $(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) $(INSTALL_DIR) $(BUILDROOT)$(docdir)
for file in $(DOCFILES); do \ for file in $(DOCFILES); do \
$(INSTALL_MAN) $$file $(BUILDROOT)$(docdir); \ $(INSTALL_MAN) $$file $(BUILDROOT)$(docdir); \
done done
echo Installing header files in $(BUILDROOT)$(includedir)...
$(INSTALL_DIR) $(BUILDROOT)$(includedir) $(INSTALL_DIR) $(BUILDROOT)$(includedir)
$(INSTALL_DATA) mxml.h $(BUILDROOT)$(includedir) $(INSTALL_DATA) mxml.h $(BUILDROOT)$(includedir)
echo Installing pkgconfig files in $(BUILDROOT)$(libdir)/pkgconfig...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig $(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig $(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
echo Installing man pages in $(BUILDROOT)$(mandir)...
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1 $(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1
$(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.1 $(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.1
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3 $(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
$(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.3 $(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.3
install-libmxml.a: install-libmxml.a:
echo Installing libmxml.a to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir) $(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir) $(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml.a $(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_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.so.1.4 $(BUILDROOT)$(libdir) $(INSTALL_LIB) libmxml.so.1.5 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.so $(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 $(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: install-libmxml.sl.1:
echo Installing libmxml.sl to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir) $(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.sl.1 $(BUILDROOT)$(libdir) $(INSTALL_LIB) libmxml.sl.1 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.so $(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.sl.1 $(BUILDROOT)$(libdir)/libmxml.sl $(LN) libmxml.sl.1 $(BUILDROOT)$(libdir)/libmxml.sl
install-libmxml.1.dylib: install-libmxml.1.dylib:
echo Installing libmxml.dylib to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir) $(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.1.dylib $(BUILDROOT)$(libdir) $(INSTALL_LIB) libmxml.1.dylib $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib $(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
@ -180,35 +195,45 @@ install-libmxml.1.dylib:
# #
uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
echo Uninstalling mxmldoc from $(BUILDROOT)$(bindir)...
$(RM) $(BUILDROOT)$(bindir)/mxmldoc $(RM) $(BUILDROOT)$(bindir)/mxmldoc
echo Uninstalling documentation from $(BUILDROOT)$(docdir)...
$(RM) -r $(BUILDROOT)$(docdir) $(RM) -r $(BUILDROOT)$(docdir)
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
$(RM) $(BUILDROOT)$(includedir)/mxml.h $(RM) $(BUILDROOT)$(includedir)/mxml.h
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc $(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
echo Uninstalling man pages from $(BUILDROOT)$(mandir)...
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.1 $(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.1
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.3 $(RM) $(BUILDROOT)$(mandir)/man3/mxml.3
uninstall-libmxml.a: uninstall-libmxml.a:
echo Uninstalling libmxml.a from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.a $(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
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1 $(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.4 $(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.4
uninstall-libmxml.sl.1: uninstall-libmxml.sl.1:
echo Uninstalling libmxml.sl from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl $(RM) $(BUILDROOT)$(libdir)/libmxml.sl
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl.1 $(RM) $(BUILDROOT)$(libdir)/libmxml.sl.1
uninstall-libmxml.1.dylib: uninstall-libmxml.1.dylib:
echo Uninstalling libmxml.dylib from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib $(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
$(RM) $(BUILDROOT)$(libdir)/libmxml.1.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 epm: all
echo Creating distribution packages...
epm --output-dir dist -v -f native mxml epm --output-dir dist -v -f native mxml
epm --output-dir dist -v -f portable mxml epm --output-dir dist -v -f portable mxml
@ -218,6 +243,7 @@ epm: all
# #
Makefile: configure Makefile.in Makefile: configure Makefile.in
echo Updating makefile...
if test -f config.status; then \ if test -f config.status; then \
./config.status --recheck; \ ./config.status --recheck; \
./config.status; \ ./config.status; \
@ -228,6 +254,7 @@ Makefile: configure Makefile.in
config.h: configure config.h.in config.h: configure config.h.in
echo Updating config.h...
autoconf autoconf
if test -f config.status; then \ if test -f config.status; then \
./config.status --recheck; \ ./config.status --recheck; \
@ -238,11 +265,24 @@ config.h: configure config.h.in
touch config.h 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
# #
libmxml.a: $(LIBOBJS) libmxml.a: $(LIBOBJS)
echo Creating $@...
$(RM) $@ $(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS) $(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@ $(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) libmxml.so.1.5: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.so.1.4 $(LIBOBJS) echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmxml.so.1.5 $(LIBOBJS)
$(RM) libmxml.so libmxml.so.1 $(RM) libmxml.so libmxml.so.1
$(LN) libmxml.so.1.4 libmxml.so $(LN) libmxml.so.1.5 libmxml.so
$(LN) libmxml.so.1.4 libmxml.so.1 $(LN) libmxml.so.1.5 libmxml.so.1
# #
@ -267,6 +308,7 @@ libmxml.so.1.4: $(LIBOBJS)
# #
libmxml.sl.1: $(LIBOBJS) libmxml.sl.1: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmxml.sl.1 $(LIBOBJS) $(DSO) $(DSOFLAGS) -o libmxml.sl.1 $(LIBOBJS)
$(RM) libmxml.sl $(RM) libmxml.sl
$(LN) libmxml.sl.1 libmxml.sl $(LN) libmxml.sl.1 libmxml.sl
@ -277,9 +319,10 @@ libmxml.sl.1: $(LIBOBJS)
# #
libmxml.1.dylib: $(LIBOBJS) libmxml.1.dylib: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmxml.1.dylib \ $(DSO) $(DSOFLAGS) -o libmxml.1.dylib \
-install_name $(libdir)/libmxml.dylib \ -install_name $(libdir)/libmxml.dylib \
-current_version 1.4.0 \ -current_version 1.5.0 \
-compatibility_version 1.0.0 \ -compatibility_version 1.0.0 \
$(LIBOBJS) $(LIBOBJS)
$(RM) libmxml.dylib $(RM) libmxml.dylib
@ -291,9 +334,11 @@ libmxml.1.dylib: $(LIBOBJS)
# #
mxmldoc: $(LIBMXML) mxmldoc.o mxmldoc: $(LIBMXML) mxmldoc.o
echo Linking $@...
$(CC) -L. $(LDFLAGS) -o $@ mxmldoc.o -lmxml $(LIBS) $(CC) -L. $(LDFLAGS) -o $@ mxmldoc.o -lmxml $(LIBS)
mxmldoc-static: libmxml.a mxmldoc.o mxmldoc-static: libmxml.a mxmldoc.o
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a $(LIBS) $(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a $(LIBS)
mxmldoc.o: mxml.h mxmldoc.o: mxml.h
@ -304,6 +349,7 @@ mxmldoc.o: mxml.h
# #
testmxml: libmxml.a testmxml.o testmxml: libmxml.a testmxml.o
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a $(LIBS) $(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a $(LIBS)
@echo Testing library... @echo Testing library...
./testmxml test.xml >temp1.xml 2>temp1s.xml ./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) mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
echo Generating API documentation...
$(RM) mxml.xml $(RM) mxml.xml
./mxmldoc-static --header doc/reference.heading mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html ./mxmldoc-static --header doc/reference.heading mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
if test "x`uname`" = xDarwin; then \ if test "x`uname`" = xDarwin; then \
@ -351,6 +398,7 @@ mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
fi fi
valgrind: mxmldoc-static valgrind: mxmldoc-static
echo Doing dynamic code analysis using Valgrind...
$(RM) valgrind.xml $(RM) valgrind.xml
valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \ valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \
valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \ valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \
@ -362,6 +410,7 @@ valgrind: mxmldoc-static
# #
doc/mxml.man: mxmldoc-static mxml.xml doc/mxml.man: mxmldoc-static mxml.xml
echo "Generating mxml(3) man page..."
$(RM) doc/mxml.man $(RM) doc/mxml.man
./mxmldoc-static --man mxml --title "Mini-XML API" \ ./mxmldoc-static --man mxml --title "Mini-XML API" \
--intro doc/intro.man --footer doc/footer.man \ --intro doc/intro.man --footer doc/footer.man \

@ -1,4 +1,4 @@
README - 2010-11-08 README - 2011-01-02
------------------- -------------------
@ -133,7 +133,7 @@ DOCUMENTATION
/* Find the first "a" element with "href" to a URL */ /* Find the first "a" element with "href" to a URL */
node = mxmlFindElement(tree, tree, "a", "href", node = mxmlFindElement(tree, tree, "a", "href",
"http://www.easysw.com/~mike/mxml/", "http://www.minixml.org/",
MXML_DESCEND); MXML_DESCEND);
/* Find the first element with a "src" attribute*/ /* Find the first element with a "src" attribute*/
@ -156,10 +156,24 @@ DOCUMENTATION
... do something ... ... 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": 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()" 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 function to recursively free the memory that is used for a particular node
@ -178,5 +192,5 @@ GETTING HELP AND REPORTING PROBLEMS
LEGAL STUFF 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". are described in the file "COPYING".

@ -3,7 +3,7 @@ dnl "$Id$"
dnl 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
dnl Copyright 2003-2010 by Michael R Sweet. dnl Copyright 2003-2011 by Michael R Sweet.
dnl dnl
dnl These coded instructions, statements, and computer programs are the dnl These coded instructions, statements, and computer programs are the
dnl property of Michael R Sweet and are protected by Federal copyright 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 case "$uname" in
SunOS* | UNIX_S*) SunOS* | UNIX_S*)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4" LIBMXML="libmxml.so.1.5"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)"
LDFLAGS="$LDFLAGS -R\$(libdir)" LDFLAGS="$LDFLAGS -R\$(libdir)"
@ -187,14 +187,14 @@ if test x$enable_shared != xno; then
IRIX) IRIX)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4" LIBMXML="libmxml.so.1.5"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)"
;; ;;
OSF1* | Linux | GNU) OSF1* | Linux | GNU)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4" LIBMXML="libmxml.so.1.5"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
@ -202,7 +202,7 @@ if test x$enable_shared != xno; then
*BSD*) *BSD*)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.4" LIBMXML="libmxml.so.1.5"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"

@ -64,7 +64,7 @@ child nodes:</p>
type = mxmlElementGetAttr(node, "type"); type = mxmlElementGetAttr(node, "type");
if (type == NULL) if (type == NULL)
type = node->value.element.name; type = mxmlGetElement(node);
if (!strcmp(type, "integer")) if (!strcmp(type, "integer"))
return (MXML_INTEGER); return (MXML_INTEGER);
@ -125,7 +125,7 @@ text editor:</p>
* just common HTML elements... * just common HTML elements...
*/ */
name = node->value.element.name; name = mxmlGetElement(node);
if (!strcmp(name, "html") || if (!strcmp(name, "html") ||
!strcmp(name, "head") || !strcmp(name, "head") ||
@ -243,10 +243,10 @@ following:</p>
*/ */
if (sscanf(data, "%u-%u-%uT%u:%u:%uZ", if (sscanf(data, "%u-%u-%uT%u:%u:%uZ",
&(dt->year), &(dt->month), &amp;(dt->year), &amp;(dt->month),
&(dt->day), &(dt->hour), &amp;(dt->day), &amp;(dt->hour),
&(dt->minute), &amp;(dt->minute),
&(dt->second)) != 6) &amp;(dt->second)) != 6)
{ {
/* /*
* Unable to read numbers, free the data * Unable to read numbers, free the data
@ -296,8 +296,7 @@ following:</p>
* function pointers... * function pointers...
*/ */
node->value.custom.data = dt; mxmlSetCustom(node, data, destroy);
node->value.custom.destroy = free;
/* /*
* Return with no errors... * 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 function which will free the custom data when the node is
deleted.</p> deleted.</p>
<!-- NEED 15 -->
<p>The save callback receives the node pointer and returns an <p>The save callback receives the node pointer and returns an
allocated string containing the custom data value. The following allocated string containing the custom data value. The following
save callback could be used for our ISO date/time type:</p> 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; iso_date_time_t *dt;
dt = (iso_date_time_t *)node->custom.data; dt = (iso_date_time_t *)mxmlGetCustom(node);
snprintf(data, sizeof(data), snprintf(data, sizeof(data),
"%04u-%02u-%02uT%02u:%02u:%02uZ", "%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 tree. Nodes in the index are sorted by element name and
attribute value.</p> attribute value.</p>
<p>Indices are stored in <a <p>Indices are stored in <a href='#mxml_index_t'><tt>mxml_index_t</tt></a>
href='#mxml_index_t'><tt>mxml_index_t</tt></a> structures. The structures. The <a href='#mxmlIndexNew'><tt>mxmlIndexNew()</tt></a> function
<a href='#mxmlIndexNew'><tt>mxmlIndexNew()</tt></a> function
creates a new index:</p> creates a new index:</p>
<pre> <pre>
@ -568,7 +567,7 @@ directives like <tt>&lt;?xml ... ?&gt;</tt> and <tt>&lt;!DOCTYPE ... &gt;</tt>
* Retain headings and titles... * Retain headings and titles...
*/ */
char *name = node->value.element.name; char *name = mxmlGetElement(node);
if (!strcmp(name, "html") || if (!strcmp(name, "html") ||
!strcmp(name, "head") || !strcmp(name, "head") ||
@ -584,8 +583,9 @@ directives like <tt>&lt;?xml ... ?&gt;</tt> and <tt>&lt;!DOCTYPE ... &gt;</tt>
} }
else if (event == MXML_SAX_DIRECTIVE) else if (event == MXML_SAX_DIRECTIVE)
mxmlRetain(node); mxmlRetain(node);
else if (event == MXML_SAX_DATA &amp;&amp; else if (event == MXML_SAX_DATA)
node->parent->ref_count > 1) {
if (mxmlGetRefCount(mxmlGetParent(node)) > 1)
{ {
/* /*
* If the parent was retained, then retain * If the parent was retained, then retain
@ -595,6 +595,7 @@ directives like <tt>&lt;?xml ... ?&gt;</tt> and <tt>&lt;!DOCTYPE ... &gt;</tt>
mxmlRetain(node); mxmlRetain(node);
} }
} }
}
</pre> </pre>
<p>The resulting skeleton document tree can then be searched just <p>The resulting skeleton document tree can then be searched just
@ -622,9 +623,9 @@ title and headings in the document would look like:</p>
if (body) if (body)
{ {
for (heading = body->child; for (heading = mxmlGetFirstChild(body);
heading; heading;
heading = heading->next) heading = mxmlGetNextSibling(heading))
print_children(heading); print_children(heading);
} }
</pre> </pre>

@ -23,7 +23,7 @@ functionality:</p>
attribute values with no preset limits, just available attribute values with no preset limits, just available
memory.</li> memory.</li>
<li>Support for integer, real, opaque ("cdata"), and text <li>Support for integer, real, opaque ("CDATA"), and text
data types in "leaf" nodes.</li> data types in "leaf" nodes.</li>
<li>"Find", "index", and "walk" functions for easily <li>"Find", "index", and "walk" functions for easily
@ -63,74 +63,12 @@ for your installation:</p>
<h2>Nodes</h2> <h2>Nodes</h2>
<p>Every piece of information in an XML file (elements, text, <p>Every piece of information in an XML file is stored in memory in "nodes".
numbers) is stored in memory in "nodes". Nodes are defined by Nodes are defined by the <a href='#mxml_node_t'><tt>mxml_node_t</tt></a>
the <a structure. Each node has a typed value, optional user data, a parent node,
href='#mxml_node_t'><tt>mxml_node_t</tt></a> sibling nodes (previous and next), and potentially child nodes.</p>
structure. The <a
href='#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='#mxml_value_t'><tt>value</tt></a> union.</p>
<!-- NEED 10 --> <p>For example, if you have an XML file like the following:</p>
<center><table width="80%" border="1" cellpadding="5" cellspacing="0" summary="Mini-XML Node Value Members">
<caption align="bottom"><i>Table 2-1: Mini-XML Node Value Members</i></caption>
<tr bgcolor="#cccccc">
<th>Value</th>
<th>Type</th>
<th>Node member</th>
</tr>
<tr>
<td>Custom</td>
<td><tt>void *</tt></td>
<td><tt>node-&gt;value.custom.data</tt></td>
</tr>
<tr>
<td>Element</td>
<td><tt>char *</tt></td>
<td><tt>node-&gt;value.element.name</tt></td>
</tr>
<tr>
<td>Integer</td>
<td><tt>int</tt></td>
<td><tt>node-&gt;value.integer</tt></td>
</tr>
<tr>
<td>Opaque (string)</td>
<td><tt>char *</tt></td>
<td><tt>node-&gt;value.opaque</tt></td>
</tr>
<tr>
<td>Real</td>
<td><tt>double</tt></td>
<td><tt>node-&gt;value.real</tt></td>
</tr>
<tr>
<td>Text</td>
<td><tt>char *</tt></td>
<td><tt>node-&gt;value.text.string</tt></td>
</tr>
</table></center>
<p>Each node also has a <tt>user_data</tt> member which allows you
to associate application-specific data with each node as needed.</p>
<p>New nodes are created using the <a
href='#mxmlNewElement'><tt>mxmlNewElement</tt></a>, <a
href='#mxmlNewInteger'><tt>mxmlNewInteger</tt></a>, <a
href='#mxmlNewOpaque'><tt>mxmlNewOpaque</tt></a>, <a
href='#mxmlNewReal'><tt>mxmlNewReal</tt></a>, <a
href='#mxmlNewText'><tt>mxmlNewText</tt></a>, <a
href='#mxmlNewTextf'><tt>mxmlNewTextf</tt></a>, and <a
href='#mxmlNewXML'><tt>mxmlNewXML</tt></a> functions. Only
elements can have child nodes, and the top node must be an element, usually the
<tt>&lt;?xml version="1.0" encoding="utf-8"?&gt;</tt> node created by
<tt>mxmlNewXML()</tt>.</p>
<p>Nodes have pointers to the node above (<tt>parent</tt>), below
(<tt>child</tt>), left (<tt>prev</tt>), and right (<tt>next</tt>)
of the current node. If you have an XML file like the following:</p>
<pre> <pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;?xml version="1.0" encoding="utf-8"?&gt;
@ -148,8 +86,7 @@ of the current node. If you have an XML file like the following:</p>
&lt;/data&gt; &lt;/data&gt;
</pre> </pre>
<p>the node tree for the file would look like the following in <p>the node tree for the file would look like the following in memory:</p>
memory:</p>
<pre> <pre>
?xml version="1.0" encoding="utf-8"? ?xml version="1.0" encoding="utf-8"?
@ -165,17 +102,127 @@ memory:</p>
val4 val5 val6 val4 val5 val6
</pre> </pre>
<p>where "-" is a pointer to the next node and "|" is a pointer <p>where "-" is a pointer to the sibling node and "|" is a pointer
to the first child node.</p> to the first child or parent node.</p>
<p>Once you are done with the XML data, use the <a <p>The <a href="#mxmlGetType"><tt>mxmlGetType</tt></a> function gets the type of
href='#mxmlDelete'><tt>mxmlDelete</tt></a> function to recursively a node, one of <tt>MXML_CUSTOM</tt>, <tt>MXML_ELEMENT</tt>,
free the memory that is used for a particular node or the entire <tt>MXML_INTEGER</tt>, <tt>MXML_OPAQUE</tt>, <tt>MXML_REAL</tt>, or
tree:</p> <tt>MXML_TEXT</tt>. The parent and sibling nodes are accessed using the
<a href="#mxmlGetParent"><tt>mxmlGetParent</tt></a>,
<a href="#mxmlGetNext"><tt>mxmlGetNext</tt></a>, and
<a href="#mxmlGetPrevious"><tt>mxmlGetPrevious</tt></a> functions. The
<a href="#mxmlGetUserData"><tt>mxmlGetUserData</tt></a> function gets any user
data associated with the node.</p>
<h3>CDATA Nodes</h3>
<p>CDATA (<tt>MXML_ELEMENT</tt>) nodes are created using the
<a href="#mxmlNewCDATA"><tt>mxmlNewCDATA</tt></a> function. The
<a href="#mxmlGetCDATA"><tt>mxmlGetCDATA</tt></a> function retrieves the
CDATA string pointer for a node.</p>
<blockquote><b>Note:</b>
<p>CDATA nodes are currently stored in memory as special elements. This will
be changed in a future major release of Mini-XML.</p>
</blockquote>
<h3>Custom Nodes</h3>
<p>Custom (<tt>MXML_CUSTOM</tt>) nodes are created using the
<a href="#mxmlNewCustom"><tt>mxmlNewCustom</tt></a> function or using a custom
load callback specified using the
<a href="#mxmlSetCustomHandlers"><tt>mxmlSetCustomHandlers</tt></a> function.
The <a href="#mxmlGetCustom"><tt>mxmlGetCustom</tt></a> function retrieves the
custom value pointer for a node.</p>
<h3>Comment Nodes</h3>
<p>Comment (<tt>MXML_ELEMENT</tt>) nodes are created using the
<a href="#mxmlNewElement"><tt>mxmlNewElement</tt></a> function. The
<a href="#mxmlGetElement"><tt>mxmlGetElement</tt></a> function retrieves the
comment string pointer for a node, including the surrounding "!--" and "--"
characters.</p>
<blockquote><b>Note:</b>
<p>Comment nodes are currently stored in memory as special elements. This will
be changed in a future major release of Mini-XML.</p>
</blockquote>
<h3>Element Nodes</h3>
<p>Element (<tt>MXML_ELEMENT</tt>) nodes are created using the
<a href="#mxmlNewElement"><tt>mxmlNewElement</tt></a> function. The
<a href="#mxmlGetElement"><tt>mxmlGetElement</tt></a> function retrieves the
element name, the
<a href="#mxmlElementGetAttr"><tt>mxmlElementGetAttr</tt></a> function retrieves
the value string for a named attribute associated with the element, and the
<a href="#mxmlGetFirstChild"><tt>mxmlGetFirstChild</tt></a> and
<a href="#mxmlGetLastChild"><tt>mxmlGetLastChild</tt></a> functions retrieve the
first and last child nodes for the element, respectively.</p>
<h3>Integer Nodes</h3>
<p>Integer (<tt>MXML_INTEGER</tt>) nodes are created using the
<a href="#mxmlNewInteger"><tt>mxmlNewInteger</tt></a> function. The
<a href="#mxmlGetInteger"><tt>mxmlGetInteger</tt></a> function retrieves the
integer value for a node.</p>
<h3>Opaque Nodes</h3>
<p>Opaque (<tt>MXML_OPAQUE</tt>) nodes are created using the
<a href="#mxmlNewOpaque"><tt>mxmlNewOpaque</tt></a> function. The
<a href="#mxmlGetOpaque"><tt>mxmlGetOpaque</tt></a> function retrieves the
opaque string pointer for a node. Opaque nodes are like string nodes but
preserve all whitespace between nodes.</p>
<h3>Text Nodes</h3>
<p>Text (<tt>MXML_TEXT</tt>) nodes are created using the
<a href="#mxmlNewText"><tt>mxmlNewText</tt></a> and
<a href="#mxmlNewTextf"><tt>mxmlNewTextf</tt></a> functions. Each text node
consists of a text string and (leading) whitespace value - the
<a href="#mxmlGetText"><tt>mxmlGetText</tt></a> function retrieves the
text string pointer and whitespace value for a node.</p>
<!-- NEED 12 -->
<h3>Processing Instruction Nodes</h3>
<p>Processing instruction (<tt>MXML_ELEMENT</tt>) nodes are created using the
<a href="#mxmlNewElement"><tt>mxmlNewElement</tt></a> function. The
<a href="#mxmlGetElement"><tt>mxmlGetElement</tt></a> function retrieves the
processing instruction string for a node, including the surrounding "?"
characters.</p>
<blockquote><b>Note:</b>
<p>Processing instruction nodes are currently stored in memory as special
elements. This will be changed in a future major release of Mini-XML.</p>
</blockquote>
<h3>Real Number Nodes</h3>
<p>Real number (<tt>MXML_REAL</tt>) nodes are created using the
<a href="#mxmlNewReal"><tt>mxmlNewReal</tt></a> function. The
<a href="#mxmlGetReal"><tt>mxmlGetReal</tt></a> function retrieves the
CDATA string pointer for a node.</p>
<!-- NEED 15 -->
<h3>XML Declaration Nodes</h3>
<p>XML declaration (<tt>MXML_ELEMENT</tt>) nodes are created using the
<a href="#mxmlNewXML"><tt>mxmlNewXML</tt></a> function. The
<a href="#mxmlGetElement"><tt>mxmlGetElement</tt></a> function retrieves the
XML declaration string for a node, including the surrounding "?" characters.</p>
<blockquote><b>Note:</b>
<p>XML declaration nodes are currently stored in memory as special elements.
This will be changed in a future major release of Mini-XML.</p>
</blockquote>
<pre>
mxmlDelete(tree);
</pre>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h2>Creating XML Documents</h2> <h2>Creating XML Documents</h2>
@ -216,41 +263,39 @@ create the XML document described in the previous section:</p>
mxmlNewText(node, 0, "val8"); mxmlNewText(node, 0, "val8");
</pre> </pre>
<p>We start by creating the <tt>&lt;?xml version="1.0" encoding="utf-8"?&gt;</tt> <!-- NEED 6 -->
node common to all XML files using the <a <p>We start by creating the declaration node common to all XML files using the
href="#mxmlNewXML"><tt>mxmlNewXML</tt></a> function:</p> <a href="#mxmlNewXML"><tt>mxmlNewXML</tt></a> function:</p>
<pre> <pre>
xml = mxmlNewXML("1.0"); xml = mxmlNewXML("1.0");
</pre> </pre>
<p>We then create the <tt>&lt;data&gt;</tt> node used for this <p>We then create the <tt>&lt;data&gt;</tt> node used for this document using
document using the <a the <a href="#mxmlNewElement"><tt>mxmlNewElement</tt></a> function. The first
href="#mxmlNewElement"><tt>mxmlNewElement</tt></a> function. The argument specifies the parent node (<tt>xml</tt>) while the second specifies the
first argument specifies the parent node (<tt>xml</tt>) while the element name (<tt>data</tt>):</p>
second specifies the element name (<tt>data</tt>):</p>
<pre> <pre>
data = mxmlNewElement(xml, "data"); data = mxmlNewElement(xml, "data");
</pre> </pre>
<p>Each <tt>&lt;node&gt;...&lt;/node&gt;</tt> in the file is <p>Each <tt>&lt;node&gt;...&lt;/node&gt;</tt> in the file is created using the
created using the <tt>mxmlNewElement</tt> and <a <tt>mxmlNewElement</tt> and <a href="#mxmlNewText"><tt>mxmlNewText</tt></a>
href="#mxmlNewText"><tt>mxmlNewText</tt></a> functions. The first functions. The first argument of <tt>mxmlNewText</tt> specifies the parent node
argument of <tt>mxmlNewText</tt> specifies the parent node (<tt>node</tt>). The second argument specifies whether whitespace appears before
(<tt>node</tt>). The second argument specifies whether whitespace the text - 0 or false in this case. The last argument specifies the actual text
appears before the text - 0 or false in this case. The last to add:</p>
argument specifies the actual text to add:</p>
<pre> <pre>
node = mxmlNewElement(data, "node"); node = mxmlNewElement(data, "node");
mxmlNewText(node, 0, "val1"); mxmlNewText(node, 0, "val1");
</pre> </pre>
<p>The resulting in-memory XML document can then be saved or <p>The resulting in-memory XML document can then be saved or processed just like
processed just like one loaded from disk or a string.</p> one loaded from disk or a string.</p>
<!-- NEW PAGE --> <!-- NEED 15 -->
<h2>Loading XML</h2> <h2>Loading XML</h2>
<p>You load an XML file using the <a <p>You load an XML file using the <a
@ -311,7 +356,7 @@ document including the <tt>?xml</tt> element if the parent node
is <tt>NULL</tt>.</p> is <tt>NULL</tt>.</p>
<!-- NEW PAGE --> <!-- NEED 15 -->
<h2>Saving XML</h2> <h2>Saving XML</h2>
<p>You save an XML file using the <a <p>You save an XML file using the <a
@ -366,6 +411,7 @@ a fixed-size buffer, while <tt>mxmlSaveAllocString()</tt>
returns a string buffer that was allocated using returns a string buffer that was allocated using
<tt>malloc()</tt>.</p> <tt>malloc()</tt>.</p>
<!-- NEED 15 -->
<h3>Controlling Line Wrapping</h3> <h3>Controlling Line Wrapping</h3>
<p>When saving XML documents, Mini-XML normally wraps output <p>When saving XML documents, Mini-XML normally wraps output
@ -382,6 +428,25 @@ overrides the default wrap margin:</p>
mxmlSetWrapMargin(0); mxmlSetWrapMargin(0);
</pre> </pre>
<h2>Memory Management</h2>
<p>Once you are done with the XML data, use the <a
href="#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>
<p>You can also use reference counting to manage memory usage. The
<a href="#mxmlRetain"><tt>mxmlRetain</tt></a> and
<a href="#mxmlRelease"><tt>mxmlRelease</tt></a> functions increment and
decrement a node's use count, respectively. When the use count goes to 0,
<tt>mxmlRelease</tt> will automatically call <tt>mxmlDelete</tt> to actually
free the memory used by the node tree. New nodes automatically start with a
use count of 1.</p>
<!-- NEW PAGE--> <!-- NEW PAGE-->
<h2>Finding and Iterating Nodes</h2> <h2>Finding and Iterating Nodes</h2>
@ -522,13 +587,15 @@ three constants:</p>
</ul> </ul>
<h2>Finding Value Nodes</h2> <h2>Finding Specific Nodes</h2>
<p>You can find the value of a specific node in the tree using the <a <p>You can find specific nodes in the tree using the <a
href='#mxmlFindValue'><tt>mxmlFindValue</tt></a>, for example: href='#mxmlFindValue'><tt>mxmlFindPath</tt></a>, for example:
<pre> <pre>
mxml_node_t *value = mxmlFindValue(tree, "path/to/*/foo/bar"); mxml_node_t *value;
value = mxmlFindPath(tree, "path/to/*/foo/bar");
</pre> </pre>
<p>The second argument is a "path" to the parent node. Each component of the <p>The second argument is a "path" to the parent node. Each component of the

@ -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 <li>Supports arbitrary element names, attributes, and attribute values
with no preset limits, just available memory.</li> 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> "leaf" nodes.</li>
<li>Functions for creating, indexing, and managing trees of data.</li> <li>Functions for creating, indexing, and managing trees of data.</li>
@ -146,6 +146,29 @@ for (node = mxmlFindElement(tree, tree, "name", NULL,
} }
</pre> </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 <p>Finally, once you are done with the XML data, use the
"<a href='#mxmlDelete'>mxmlDelete()</a>" function to recursively free the "<a href='#mxmlDelete'>mxmlDelete()</a>" function to recursively free the
memory that is used for a particular node or the entire tree:</p> memory that is used for a particular node or the entire tree:</p>

@ -1,4 +1,4 @@
.SH SEE ALSO .SH SEE ALSO
mxmldoc(1), Mini-XML Programmers Manual, http://www.minixml.org/ mxmldoc(1), Mini-XML Programmers Manual, http://www.minixml.org/
.SH COPYRIGHT .SH COPYRIGHT
Copyright 2003-2008 by Michael Sweet. Copyright 2003-2011 by Michael Sweet.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

@ -94,7 +94,7 @@ of formats. The <tt>epm</tt> program is available from the
following URL:</p> following URL:</p>
<pre> <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> </pre>
<p>Use the <tt>make</tt> command with the <kbd>epm</kbd> target <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 <p>Thanks to lots of feedback and support from various
developers, Mini-XML has evolved since then to provide a more 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 lines of code, compared to 103,893 lines of code for libxml2
version 2.6.9.</p> version 2.6.9.</p>

@ -19,7 +19,7 @@ preserving the XML data hierarchy.
Supports arbitrary element names, attributes, and attribute Supports arbitrary element names, attributes, and attribute
values with no preset limits, just available memory. values with no preset limits, just available memory.
.IP \(bu 4 .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. "leaf" nodes.
.IP \(bu 4 .IP \(bu 4
Functions for creating, indexing, and managing trees of data. Functions for creating, indexing, and managing trees of data.
@ -141,11 +141,27 @@ You can also iterate with the same function:
} }
.fi .fi
.PP .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: function:
.nf .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 .fi
.PP .PP
Finally, once you are done with the XML data, use the 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 the terms of the GNU Library General Public License version 2
(LGPL2) with the following exceptions:</p> (LGPL2) with the following exceptions:</p>
<ol> <p><b>1.</b> Static linking of applications to the Mini-XML
library does not constitute a derivative work and does
<li>Static linking of applications to the Mini-XML not require the author to provide source code for the
library does not constitute a derivative work and does application, use the shared Mini-XML libraries, or link
not require the author to provide source code for the their applications against a user-supplied version of
application, use the shared Mini-XML libraries, or link Mini-XML.</p>
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
<p><i>If you link the application to a modified version provided under the terms of the LGPL2 in sections 1, 2,
of Mini-XML, then the changes to Mini-XML must be and 4.</i></p>
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
</li> license with programs that are linked to the Mini-XML
library, nor do you have to identify the Mini-XML license
<li>You do not have to provide a copy of the Mini-XML in your program or documentation as required by section 6
license with programs that are linked to the Mini-XML of the LGPL2.</p>
library, nor do you have to identify the Mini-XML license
in your program or documentation as required by section 6 <p>&nbsp;</p>
of the LGPL2.</li>
</ol>
<!-- NEW PAGE -->
<p align=center><b>GNU LIBRARY GENERAL PUBLIC LICENSE</b></p> <p align=center><b>GNU LIBRARY GENERAL PUBLIC LICENSE</b></p>
<p align='center'>Version 2, June 1991 <p align='center'>Version 2, June 1991
<br>Copyright (C) 1991 Free Software Foundation, Inc. <br>Copyright (C) 1991 Free Software Foundation, Inc.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

@ -44,7 +44,20 @@ A { text-decoration: none }
<B><A HREF="#BASICS">Getting Started with Mini-XML</A></B> <B><A HREF="#BASICS">Getting Started with Mini-XML</A></B>
<UL> <UL>
<LI><A HREF="#3_1">The Basics</A></LI> <LI><A HREF="#3_1">The Basics</A></LI>
<LI><A HREF="#3_2">Nodes</A></LI> <LI><A HREF="#3_2">Nodes</A>
<UL>
<LI><A HREF="#3_2_1">CDATA Nodes</A></LI>
<LI><A HREF="#3_2_2">Custom Nodes</A></LI>
<LI><A HREF="#3_2_3">Comment Nodes</A></LI>
<LI><A HREF="#3_2_4">Element Nodes</A></LI>
<LI><A HREF="#3_2_5">Integer Nodes</A></LI>
<LI><A HREF="#3_2_6">Opaque Nodes</A></LI>
<LI><A HREF="#3_2_7">Text Nodes</A></LI>
<LI><A HREF="#3_2_8">Processing Instruction Nodes</A></LI>
<LI><A HREF="#3_2_9">Real Number Nodes</A></LI>
<LI><A HREF="#3_2_10">XML Declaration Nodes</A></LI>
</UL>
</LI>
<LI><A HREF="#3_3">Creating XML Documents</A></LI> <LI><A HREF="#3_3">Creating XML Documents</A></LI>
<LI><A HREF="#3_4">Loading XML</A></LI> <LI><A HREF="#3_4">Loading XML</A></LI>
<LI><A HREF="#3_5">Saving XML</A> <LI><A HREF="#3_5">Saving XML</A>
@ -52,8 +65,9 @@ A { text-decoration: none }
<LI><A HREF="#3_5_1">Controlling Line Wrapping</A></LI> <LI><A HREF="#3_5_1">Controlling Line Wrapping</A></LI>
</UL> </UL>
</LI> </LI>
<LI><A HREF="#3_6">Finding and Iterating Nodes</A></LI> <LI><A HREF="#3_6">Memory Management</A></LI>
<LI><A HREF="#3_7">Finding Value Nodes</A></LI> <LI><A HREF="#3_7">Finding and Iterating Nodes</A></LI>
<LI><A HREF="#3_8">Finding Specific Nodes</A></LI>
</UL> </UL>
<B><A HREF="#ADVANCED">More Mini-XML Programming Techniques</A></B> <B><A HREF="#ADVANCED">More Mini-XML Programming Techniques</A></B>
<UL> <UL>
@ -96,51 +110,52 @@ A { text-decoration: none }
<LI><A HREF="#mxmlEntityGetValue">mxmlEntityGetValue</A></LI> <LI><A HREF="#mxmlEntityGetValue">mxmlEntityGetValue</A></LI>
<LI><A HREF="#mxmlEntityRemoveCallback">mxmlEntityRemoveCallback</A></LI> <LI><A HREF="#mxmlEntityRemoveCallback">mxmlEntityRemoveCallback</A></LI>
<LI><A HREF="#mxmlFindElement">mxmlFindElement</A></LI> <LI><A HREF="#mxmlFindElement">mxmlFindElement</A></LI>
<LI><A HREF="#8_2_12">mxmlFindValue</A></LI> <LI><A HREF="#8_2_12">mxmlFindPath</A></LI>
<LI><A HREF="#8_2_13">mxmlGetCDATA</A></LI> <LI><A HREF="#8_2_13">mxmlGetCDATA</A></LI>
<LI><A HREF="#8_2_14">mxmlGetCustom</A></LI> <LI><A HREF="#8_2_14">mxmlGetCustom</A></LI>
<LI><A HREF="#8_2_15">mxmlGetElement</A></LI> <LI><A HREF="#8_2_15">mxmlGetElement</A></LI>
<LI><A HREF="#8_2_16">mxmlGetFirstChild</A></LI> <LI><A HREF="#8_2_16">mxmlGetFirstChild</A></LI>
<LI><A HREF="#8_2_17">mxmlGetInteger</A></LI> <LI><A HREF="#8_2_17">mxmlGetInteger</A></LI>
<LI><A HREF="#8_2_18">mxmlGetLastChild</A></LI> <LI><A HREF="#8_2_18">mxmlGetLastChild</A></LI>
<LI><A HREF="#mxmlGetNext">mxmlGetNext</A></LI> <LI><A HREF="#mxmlGetNextSibling">mxmlGetNextSibling</A></LI>
<LI><A HREF="#8_2_20">mxmlGetOpaque</A></LI> <LI><A HREF="#8_2_20">mxmlGetOpaque</A></LI>
<LI><A HREF="#8_2_21">mxmlGetParent</A></LI> <LI><A HREF="#8_2_21">mxmlGetParent</A></LI>
<LI><A HREF="#8_2_22">mxmlGetPrevious</A></LI> <LI><A HREF="#8_2_22">mxmlGetPrevSibling</A></LI>
<LI><A HREF="#8_2_23">mxmlGetReal</A></LI> <LI><A HREF="#8_2_23">mxmlGetReal</A></LI>
<LI><A HREF="#8_2_24">mxmlGetText</A></LI> <LI><A HREF="#8_2_24">mxmlGetRefCount</A></LI>
<LI><A HREF="#8_2_25">mxmlGetType</A></LI> <LI><A HREF="#8_2_25">mxmlGetText</A></LI>
<LI><A HREF="#8_2_26">mxmlGetUserData</A></LI> <LI><A HREF="#8_2_26">mxmlGetType</A></LI>
<LI><A HREF="#8_2_27">mxmlGetUserData</A></LI>
<LI><A HREF="#mxmlIndexDelete">mxmlIndexDelete</A></LI> <LI><A HREF="#mxmlIndexDelete">mxmlIndexDelete</A></LI>
<LI><A HREF="#mxmlIndexEnum">mxmlIndexEnum</A></LI> <LI><A HREF="#mxmlIndexEnum">mxmlIndexEnum</A></LI>
<LI><A HREF="#mxmlIndexFind">mxmlIndexFind</A></LI> <LI><A HREF="#mxmlIndexFind">mxmlIndexFind</A></LI>
<LI><A HREF="#8_2_30">mxmlIndexGetCount</A></LI> <LI><A HREF="#8_2_31">mxmlIndexGetCount</A></LI>
<LI><A HREF="#mxmlIndexNew">mxmlIndexNew</A></LI> <LI><A HREF="#mxmlIndexNew">mxmlIndexNew</A></LI>
<LI><A HREF="#mxmlIndexReset">mxmlIndexReset</A></LI> <LI><A HREF="#mxmlIndexReset">mxmlIndexReset</A></LI>
<LI><A HREF="#mxmlLoadFd">mxmlLoadFd</A></LI> <LI><A HREF="#mxmlLoadFd">mxmlLoadFd</A></LI>
<LI><A HREF="#mxmlLoadFile">mxmlLoadFile</A></LI> <LI><A HREF="#mxmlLoadFile">mxmlLoadFile</A></LI>
<LI><A HREF="#mxmlLoadString">mxmlLoadString</A></LI> <LI><A HREF="#mxmlLoadString">mxmlLoadString</A></LI>
<LI><A HREF="#8_2_36">mxmlNewCDATA</A></LI> <LI><A HREF="#8_2_37">mxmlNewCDATA</A></LI>
<LI><A HREF="#8_2_37">mxmlNewCustom</A></LI> <LI><A HREF="#8_2_38">mxmlNewCustom</A></LI>
<LI><A HREF="#mxmlNewElement">mxmlNewElement</A></LI> <LI><A HREF="#mxmlNewElement">mxmlNewElement</A></LI>
<LI><A HREF="#mxmlNewInteger">mxmlNewInteger</A></LI> <LI><A HREF="#mxmlNewInteger">mxmlNewInteger</A></LI>
<LI><A HREF="#mxmlNewOpaque">mxmlNewOpaque</A></LI> <LI><A HREF="#mxmlNewOpaque">mxmlNewOpaque</A></LI>
<LI><A HREF="#mxmlNewReal">mxmlNewReal</A></LI> <LI><A HREF="#mxmlNewReal">mxmlNewReal</A></LI>
<LI><A HREF="#mxmlNewText">mxmlNewText</A></LI> <LI><A HREF="#mxmlNewText">mxmlNewText</A></LI>
<LI><A HREF="#mxmlNewTextf">mxmlNewTextf</A></LI> <LI><A HREF="#mxmlNewTextf">mxmlNewTextf</A></LI>
<LI><A HREF="#8_2_44">mxmlNewXML</A></LI> <LI><A HREF="#8_2_45">mxmlNewXML</A></LI>
<LI><A HREF="#8_2_45">mxmlRelease</A></LI> <LI><A HREF="#8_2_46">mxmlRelease</A></LI>
<LI><A HREF="#mxmlRemove">mxmlRemove</A></LI> <LI><A HREF="#mxmlRemove">mxmlRemove</A></LI>
<LI><A HREF="#8_2_47">mxmlRetain</A></LI> <LI><A HREF="#8_2_48">mxmlRetain</A></LI>
<LI><A HREF="#8_2_48">mxmlSAXLoadFd</A></LI> <LI><A HREF="#8_2_49">mxmlSAXLoadFd</A></LI>
<LI><A HREF="#8_2_49">mxmlSAXLoadFile</A></LI> <LI><A HREF="#8_2_50">mxmlSAXLoadFile</A></LI>
<LI><A HREF="#8_2_50">mxmlSAXLoadString</A></LI> <LI><A HREF="#8_2_51">mxmlSAXLoadString</A></LI>
<LI><A HREF="#mxmlSaveAllocString">mxmlSaveAllocString</A></LI> <LI><A HREF="#mxmlSaveAllocString">mxmlSaveAllocString</A></LI>
<LI><A HREF="#mxmlSaveFd">mxmlSaveFd</A></LI> <LI><A HREF="#mxmlSaveFd">mxmlSaveFd</A></LI>
<LI><A HREF="#mxmlSaveFile">mxmlSaveFile</A></LI> <LI><A HREF="#mxmlSaveFile">mxmlSaveFile</A></LI>
<LI><A HREF="#mxmlSaveString">mxmlSaveString</A></LI> <LI><A HREF="#mxmlSaveString">mxmlSaveString</A></LI>
<LI><A HREF="#8_2_55">mxmlSetCDATA</A></LI> <LI><A HREF="#8_2_56">mxmlSetCDATA</A></LI>
<LI><A HREF="#8_2_56">mxmlSetCustom</A></LI> <LI><A HREF="#8_2_57">mxmlSetCustom</A></LI>
<LI><A HREF="#mxmlSetCustomHandlers">mxmlSetCustomHandlers</A></LI> <LI><A HREF="#mxmlSetCustomHandlers">mxmlSetCustomHandlers</A></LI>
<LI><A HREF="#mxmlSetElement">mxmlSetElement</A></LI> <LI><A HREF="#mxmlSetElement">mxmlSetElement</A></LI>
<LI><A HREF="#mxmlSetErrorCallback">mxmlSetErrorCallback</A></LI> <LI><A HREF="#mxmlSetErrorCallback">mxmlSetErrorCallback</A></LI>
@ -149,8 +164,8 @@ A { text-decoration: none }
<LI><A HREF="#mxmlSetReal">mxmlSetReal</A></LI> <LI><A HREF="#mxmlSetReal">mxmlSetReal</A></LI>
<LI><A HREF="#mxmlSetText">mxmlSetText</A></LI> <LI><A HREF="#mxmlSetText">mxmlSetText</A></LI>
<LI><A HREF="#mxmlSetTextf">mxmlSetTextf</A></LI> <LI><A HREF="#mxmlSetTextf">mxmlSetTextf</A></LI>
<LI><A HREF="#8_2_65">mxmlSetUserData</A></LI> <LI><A HREF="#8_2_66">mxmlSetUserData</A></LI>
<LI><A HREF="#8_2_66">mxmlSetWrapMargin</A></LI> <LI><A HREF="#8_2_67">mxmlSetWrapMargin</A></LI>
<LI><A HREF="#mxmlWalkNext">mxmlWalkNext</A></LI> <LI><A HREF="#mxmlWalkNext">mxmlWalkNext</A></LI>
<LI><A HREF="#mxmlWalkPrev">mxmlWalkPrev</A></LI> <LI><A HREF="#mxmlWalkPrev">mxmlWalkPrev</A></LI>
</UL> </UL>
@ -203,7 +218,7 @@ libxml2</TT> library with something substantially smaller and
libxml2.</P> libxml2.</P>
<P>Thanks to lots of feedback and support from various developers, <P>Thanks to lots of feedback and support from various developers,
Mini-XML has evolved since then to provide a more complete XML Mini-XML has evolved since then to provide a more complete XML
implementation and now stands at a whopping 3,747 lines of code, 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> compared to 103,893 lines of code for libxml2 version 2.6.9.</P>
<P>Aside from Gutenprint, Mini-XML is used for the following <P>Aside from Gutenprint, Mini-XML is used for the following
projects/software applications:</P> projects/software applications:</P>
@ -386,7 +401,7 @@ rpmbuild(8)</TT> software to create Red Hat Package Manager (&quot;RPM&quot;)
epm(1)</TT> program to create software packages in a variety of formats. 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> The <TT>epm</TT> program is available from the following URL:</P>
<PRE> <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> </PRE>
<P>Use the <TT>make</TT> command with the <KBD>epm</KBD> target to <P>Use the <TT>make</TT> command with the <KBD>epm</KBD> target to
create portable and native packages for your system:</P> create portable and native packages for your system:</P>
@ -413,7 +428,7 @@ hspace="10" src="2.gif" width="100"></A>Getting Started with Mini-XML</H1>
<LI>Writing of UTF-8 encoded XML files and strings.</LI> <LI>Writing of UTF-8 encoded XML files and strings.</LI>
<LI>Support for arbitrary element names, attributes, and attribute <LI>Support for arbitrary element names, attributes, and attribute
values with no preset limits, just available memory.</LI> values with no preset limits, just available memory.</LI>
<LI>Support for integer, real, opaque (&quot;cdata&quot;), and text data types in <LI>Support for integer, real, opaque (&quot;CDATA&quot;), and text data types in
&quot;leaf&quot; nodes.</LI> &quot;leaf&quot; nodes.</LI>
<LI>&quot;Find&quot;, &quot;index&quot;, and &quot;walk&quot; functions for easily accessing data in <LI>&quot;Find&quot;, &quot;index&quot;, and &quot;walk&quot; functions for easily accessing data in
an XML document.</LI> an XML document.</LI>
@ -440,47 +455,12 @@ hspace="10" src="2.gif" width="100"></A>Getting Started with Mini-XML</H1>
<KBD>pkg-config --libs mxml ENTER</KBD> <KBD>pkg-config --libs mxml ENTER</KBD>
</PRE> </PRE>
<H2><A NAME="3_2">Nodes</A></H2> <H2><A NAME="3_2">Nodes</A></H2>
<P>Every piece of information in an XML file (elements, text, numbers) <P>Every piece of information in an XML file is stored in memory in
is stored in memory in &quot;nodes&quot;. Nodes are defined by the <A href="#mxml_node_t"> &quot;nodes&quot;. Nodes are defined by the <A href="#mxml_node_t"><TT>
<TT>mxml_node_t</TT></A> structure. The <A href="#mxml_type_t"><TT>type</TT> mxml_node_t</TT></A> structure. Each node has a typed value, optional
</A> member defines the node type (element, integer, opaque, real, or user data, a parent node, sibling nodes (previous and next), and
text) which determines which value you want to look at in the <A href="#mxml_value_t"> potentially child nodes.</P>
<TT>value</TT></A> union.</P> <P>For example, if you have an XML file like the following:</P>
<!-- NEED 10 -->
<CENTER>
<TABLE border="1" cellpadding="5" cellspacing="0" summary="Mini-XML Node Value Members"
width="80%"><CAPTION align="bottom"><I> Table 2-1: Mini-XML Node Value
Members</I></CAPTION>
<TR bgcolor="#cccccc"><TH>Value</TH><TH>Type</TH><TH>Node member</TH></TR>
<TR><TD>Custom</TD><TD><TT>void *</TT></TD><TD><TT>
node-&gt;value.custom.data</TT></TD></TR>
<TR><TD>Element</TD><TD><TT>char *</TT></TD><TD><TT>
node-&gt;value.element.name</TT></TD></TR>
<TR><TD>Integer</TD><TD><TT>int</TT></TD><TD><TT>node-&gt;value.integer</TT>
</TD></TR>
<TR><TD>Opaque (string)</TD><TD><TT>char *</TT></TD><TD><TT>
node-&gt;value.opaque</TT></TD></TR>
<TR><TD>Real</TD><TD><TT>double</TT></TD><TD><TT>node-&gt;value.real</TT></TD>
</TR>
<TR><TD>Text</TD><TD><TT>char *</TT></TD><TD><TT>node-&gt;value.text.string</TT>
</TD></TR>
</TABLE>
</CENTER>
<P>Each node also has a <TT>user_data</TT> member which allows you to
associate application-specific data with each node as needed.</P>
<P>New nodes are created using the <A href="#mxmlNewElement"><TT>
mxmlNewElement</TT></A>, <A href="#mxmlNewInteger"><TT>mxmlNewInteger</TT>
</A>, <A href="#mxmlNewOpaque"><TT>mxmlNewOpaque</TT></A>, <A href="#mxmlNewReal">
<TT>mxmlNewReal</TT></A>, <A href="#mxmlNewText"><TT>mxmlNewText</TT></A>
, <A href="#mxmlNewTextf"><TT>mxmlNewTextf</TT></A>, and <A href="#mxmlNewXML">
<TT>mxmlNewXML</TT></A> functions. Only elements can have child nodes,
and the top node must be an element, usually the <TT>&lt;?xml
version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</TT> node created by <TT>mxmlNewXML()</TT>
.</P>
<P>Nodes have pointers to the node above (<TT>parent</TT>), below (<TT>
child</TT>), left (<TT>prev</TT>), and right (<TT>next</TT>) of the
current node. If you have an XML file like the following:</P>
<PRE> <PRE>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;data&gt; &lt;data&gt;
@ -510,15 +490,96 @@ child</TT>), left (<TT>prev</TT>), and right (<TT>next</TT>) of the
| | | | | |
val4 val5 val6 val4 val5 val6
</PRE> </PRE>
<P>where &quot;-&quot; is a pointer to the next node and &quot;|&quot; is a pointer to the <P>where &quot;-&quot; is a pointer to the sibling node and &quot;|&quot; is a pointer to
first child node.</P> the first child or parent node.</P>
<P>Once you are done with the XML data, use the <A href="#mxmlDelete"><TT> <P>The <A href="#mxmlGetType"><TT>mxmlGetType</TT></A> function gets the
mxmlDelete</TT></A> function to recursively free the memory that is used type of a node, one of <TT>MXML_CUSTOM</TT>, <TT>MXML_ELEMENT</TT>, <TT>
for a particular node or the entire tree:</P> MXML_INTEGER</TT>, <TT>MXML_OPAQUE</TT>, <TT>MXML_REAL</TT>, or <TT>
<PRE> MXML_TEXT</TT>. The parent and sibling nodes are accessed using the <A href="#mxmlGetParent">
mxmlDelete(tree); <TT>mxmlGetParent</TT></A>, <A href="#mxmlGetNext"><TT>mxmlGetNext</TT></A>
</PRE> , and <A href="#mxmlGetPrevious"><TT>mxmlGetPrevious</TT></A> functions.
The <A href="#mxmlGetUserData"><TT>mxmlGetUserData</TT></A> function
gets any user data associated with the node.</P>
<H3><A NAME="3_2_1">CDATA Nodes</A></H3>
<P>CDATA (<TT>MXML_ELEMENT</TT>) nodes are created using the <A href="#mxmlNewCDATA">
<TT>mxmlNewCDATA</TT></A> function. The <A href="#mxmlGetCDATA"><TT>
mxmlGetCDATA</TT></A> function retrieves the CDATA string pointer for a
node.</P>
<BLOCKQUOTE><B>Note:</B>
<P>CDATA nodes are currently stored in memory as special elements. This
will be changed in a future major release of Mini-XML.</P>
</BLOCKQUOTE>
<H3><A NAME="3_2_2">Custom Nodes</A></H3>
<P>Custom (<TT>MXML_CUSTOM</TT>) nodes are created using the <A href="#mxmlNewCustom">
<TT>mxmlNewCustom</TT></A> function or using a custom load callback
specified using the <A href="#mxmlSetCustomHandlers"><TT>
mxmlSetCustomHandlers</TT></A> function. The <A href="#mxmlGetCustom"><TT>
mxmlGetCustom</TT></A> function retrieves the custom value pointer for a
node.</P>
<H3><A NAME="3_2_3">Comment Nodes</A></H3>
<P>Comment (<TT>MXML_ELEMENT</TT>) nodes are created using the <A href="#mxmlNewElement">
<TT>mxmlNewElement</TT></A> function. The <A href="#mxmlGetElement"><TT>
mxmlGetElement</TT></A> function retrieves the comment string pointer
for a node, including the surrounding &quot;!--&quot; and &quot;--&quot; characters.</P>
<BLOCKQUOTE><B>Note:</B>
<P>Comment nodes are currently stored in memory as special elements.
This will be changed in a future major release of Mini-XML.</P>
</BLOCKQUOTE>
<H3><A NAME="3_2_4">Element Nodes</A></H3>
<P>Element (<TT>MXML_ELEMENT</TT>) nodes are created using the <A href="#mxmlNewElement">
<TT>mxmlNewElement</TT></A> function. The <A href="#mxmlGetElement"><TT>
mxmlGetElement</TT></A> function retrieves the element name, the <A href="#mxmlElementGetAttr">
<TT>mxmlElementGetAttr</TT></A> function retrieves the value string for
a named attribute associated with the element, and the <A href="#mxmlGetFirstChild">
<TT>mxmlGetFirstChild</TT></A> and <A href="#mxmlGetLastChild"><TT>
mxmlGetLastChild</TT></A> functions retrieve the first and last child
nodes for the element, respectively.</P>
<H3><A NAME="3_2_5">Integer Nodes</A></H3>
<P>Integer (<TT>MXML_INTEGER</TT>) nodes are created using the <A href="#mxmlNewInteger">
<TT>mxmlNewInteger</TT></A> function. The <A href="#mxmlGetInteger"><TT>
mxmlGetInteger</TT></A> function retrieves the integer value for a node.</P>
<H3><A NAME="3_2_6">Opaque Nodes</A></H3>
<P>Opaque (<TT>MXML_OPAQUE</TT>) nodes are created using the <A href="#mxmlNewOpaque">
<TT>mxmlNewOpaque</TT></A> function. The <A href="#mxmlGetOpaque"><TT>
mxmlGetOpaque</TT></A> function retrieves the opaque string pointer for
a node. Opaque nodes are like string nodes but preserve all whitespace
between nodes.</P>
<H3><A NAME="3_2_7">Text Nodes</A></H3>
<P>Text (<TT>MXML_TEXT</TT>) nodes are created using the <A href="#mxmlNewText">
<TT>mxmlNewText</TT></A> and <A href="#mxmlNewTextf"><TT>mxmlNewTextf</TT>
</A> functions. Each text node consists of a text string and (leading)
whitespace value - the <A href="#mxmlGetText"><TT>mxmlGetText</TT></A>
function retrieves the text string pointer and whitespace value for a
node.</P>
<!-- NEED 12 -->
<H3><A NAME="3_2_8">Processing Instruction Nodes</A></H3>
<P>Processing instruction (<TT>MXML_ELEMENT</TT>) nodes are created
using the <A href="#mxmlNewElement"><TT>mxmlNewElement</TT></A>
function. The <A href="#mxmlGetElement"><TT>mxmlGetElement</TT></A>
function retrieves the processing instruction string for a node,
including the surrounding &quot;?&quot; characters.</P>
<BLOCKQUOTE><B>Note:</B>
<P>Processing instruction nodes are currently stored in memory as
special elements. This will be changed in a future major release of
Mini-XML.</P>
</BLOCKQUOTE>
<H3><A NAME="3_2_9">Real Number Nodes</A></H3>
<P>Real number (<TT>MXML_REAL</TT>) nodes are created using the <A href="#mxmlNewReal">
<TT>mxmlNewReal</TT></A> function. The <A href="#mxmlGetReal"><TT>
mxmlGetReal</TT></A> function retrieves the CDATA string pointer for a
node.</P>
<!-- NEED 15 -->
<H3><A NAME="3_2_10">XML Declaration Nodes</A></H3>
<P>XML declaration (<TT>MXML_ELEMENT</TT>) nodes are created using the <A
href="#mxmlNewXML"><TT>mxmlNewXML</TT></A> function. The <A href="#mxmlGetElement">
<TT>mxmlGetElement</TT></A> function retrieves the XML declaration
string for a node, including the surrounding &quot;?&quot; characters.</P>
<BLOCKQUOTE><B>Note:</B>
<P>XML declaration nodes are currently stored in memory as special
elements. This will be changed in a future major release of Mini-XML.</P>
</BLOCKQUOTE>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<H2><A NAME="3_3">Creating XML Documents</A></H2> <H2><A NAME="3_3">Creating XML Documents</A></H2>
<P>You can create and update XML documents in memory using the various <TT> <P>You can create and update XML documents in memory using the various <TT>
@ -555,9 +616,10 @@ mxmlNew</TT> functions. The following code will create the XML document
node = mxmlNewElement(data, &quot;node&quot;); node = mxmlNewElement(data, &quot;node&quot;);
mxmlNewText(node, 0, &quot;val8&quot;); mxmlNewText(node, 0, &quot;val8&quot;);
</PRE> </PRE>
<P>We start by creating the <TT>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</TT>
node common to all XML files using the <A href="#mxmlNewXML"><TT> <!-- NEED 6 -->
mxmlNewXML</TT></A> function:</P> <P>We start by creating the declaration node common to all XML files
using the <A href="#mxmlNewXML"><TT>mxmlNewXML</TT></A> function:</P>
<PRE> <PRE>
xml = mxmlNewXML(&quot;1.0&quot;); xml = mxmlNewXML(&quot;1.0&quot;);
</PRE> </PRE>
@ -581,7 +643,7 @@ mxmlNewElement</TT> and <A href="#mxmlNewText"><TT>mxmlNewText</TT></A>
<P>The resulting in-memory XML document can then be saved or processed <P>The resulting in-memory XML document can then be saved or processed
just like one loaded from disk or a string.</P> just like one loaded from disk or a string.</P>
<!-- NEW PAGE --> <!-- NEED 15 -->
<H2><A NAME="3_4">Loading XML</A></H2> <H2><A NAME="3_4">Loading XML</A></H2>
<P>You load an XML file using the <A href="#mxmlLoadFile"><TT> <P>You load an XML file using the <A href="#mxmlLoadFile"><TT>
mxmlLoadFile</TT></A> function:</P> mxmlLoadFile</TT></A> function:</P>
@ -629,7 +691,7 @@ mxmlLoadFile()</TT>. The second argument specifies the string or
character buffer to load and must be a complete XML document including character buffer to load and must be a complete XML document including
the <TT>?xml</TT> element if the parent node is <TT>NULL</TT>.</P> the <TT>?xml</TT> element if the parent node is <TT>NULL</TT>.</P>
<!-- NEW PAGE --> <!-- NEED 15 -->
<H2><A NAME="3_5">Saving XML</A></H2> <H2><A NAME="3_5">Saving XML</A></H2>
<P>You save an XML file using the <A href="#mxmlSaveFile"><TT> <P>You save an XML file using the <A href="#mxmlSaveFile"><TT>
mxmlSaveFile</TT></A> function:</P> mxmlSaveFile</TT></A> function:</P>
@ -670,6 +732,8 @@ mxmlSaveFile()</TT>. The <TT>mxmlSaveString</TT> function takes pointer
and size arguments for saving the XML document to a fixed-size buffer, and size arguments for saving the XML document to a fixed-size buffer,
while <TT>mxmlSaveAllocString()</TT> returns a string buffer that was while <TT>mxmlSaveAllocString()</TT> returns a string buffer that was
allocated using <TT>malloc()</TT>.</P> allocated using <TT>malloc()</TT>.</P>
<!-- NEED 15 -->
<H3><A NAME="3_5_1">Controlling Line Wrapping</A></H3> <H3><A NAME="3_5_1">Controlling Line Wrapping</A></H3>
<P>When saving XML documents, Mini-XML normally wraps output lines at <P>When saving XML documents, Mini-XML normally wraps output lines at
column 75 so that the text is readable in terminal windows. The <A href="#mxmlSetWrapMargin"> column 75 so that the text is readable in terminal windows. The <A href="#mxmlSetWrapMargin">
@ -682,9 +746,22 @@ mxmlSaveFile()</TT>. The <TT>mxmlSaveString</TT> function takes pointer
/* Disable wrapping */ /* Disable wrapping */
mxmlSetWrapMargin(0); mxmlSetWrapMargin(0);
</PRE> </PRE>
<H2><A NAME="3_6">Memory Management</A></H2>
<P>Once you are done with the XML data, use the <A href="#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>
<P>You can also use reference counting to manage memory usage. The <A href="#mxmlRetain">
<TT>mxmlRetain</TT></A> and <A href="#mxmlRelease"><TT>mxmlRelease</TT></A>
functions increment and decrement a node's use count, respectively.
When the use count goes to 0, <TT>mxmlRelease</TT> will automatically
call <TT>mxmlDelete</TT> to actually free the memory used by the node
tree. New nodes automatically start with a use count of 1.</P>
<!-- NEW PAGE--> <!-- NEW PAGE-->
<H2><A NAME="3_6">Finding and Iterating Nodes</A></H2> <H2><A NAME="3_7">Finding and Iterating Nodes</A></H2>
<P>The <A href="#mxmlWalkPrev"><TT>mxmlWalkPrev</TT></A> and <A href="#mxmlWalkNext"> <P>The <A href="#mxmlWalkPrev"><TT>mxmlWalkPrev</TT></A> and <A href="#mxmlWalkNext">
<TT>mxmlWalkNext</TT></A>functions can be used to iterate through the <TT>mxmlWalkNext</TT></A>functions can be used to iterate through the
XML node tree:</P> XML node tree:</P>
@ -806,11 +883,13 @@ mxmlSaveFile()</TT>. The <TT>mxmlSaveString</TT> function takes pointer
the order would be reversed, ending at &quot;?xml&quot;.</P> the order would be reversed, ending at &quot;?xml&quot;.</P>
</LI> </LI>
</UL> </UL>
<H2><A NAME="3_7">Finding Value Nodes</A></H2> <H2><A NAME="3_8">Finding Specific Nodes</A></H2>
<P>You can find the value of a specific node in the tree using the <A href="#mxmlFindValue"> <P>You can find specific nodes in the tree using the <A href="#mxmlFindValue">
<TT>mxmlFindValue</TT></A>, for example:</P> <TT>mxmlFindPath</TT></A>, for example:</P>
<PRE> <PRE>
mxml_node_t *value = mxmlFindValue(tree, &quot;path/to/*/foo/bar&quot;); mxml_node_t *value;
value = mxmlFindPath(tree, &quot;path/to/*/foo/bar&quot;);
</PRE> </PRE>
<P>The second argument is a &quot;path&quot; to the parent node. Each component of <P>The second argument is a &quot;path&quot; to the parent node. Each component of
the path is separated by a slash (/) and represents a named element in the path is separated by a slash (/) and represents a named element in
@ -865,7 +944,7 @@ MXML_REAL</TT>, or <TT>MXML_TEXT</TT>. The function is called<I> after</I>
type = mxmlElementGetAttr(node, &quot;type&quot;); type = mxmlElementGetAttr(node, &quot;type&quot;);
if (type == NULL) if (type == NULL)
type = node-&gt;value.element.name; type = mxmlGetElement(node);
if (!strcmp(type, &quot;integer&quot;)) if (!strcmp(type, &quot;integer&quot;))
return (MXML_INTEGER); return (MXML_INTEGER);
@ -916,7 +995,7 @@ MXML_WS_BEFORE_CLOSE</TT>, or <TT>MXML_WS_AFTER_CLOSE</TT>. The callback
* just common HTML elements... * just common HTML elements...
*/ */
name = node-&gt;value.element.name; name = mxmlGetElement(node);
if (!strcmp(name, &quot;html&quot;) || if (!strcmp(name, &quot;html&quot;) ||
!strcmp(name, &quot;head&quot;) || !strcmp(name, &quot;head&quot;) ||
@ -1080,8 +1159,7 @@ MXML_WS_BEFORE_CLOSE</TT>, or <TT>MXML_WS_AFTER_CLOSE</TT>. The callback
* function pointers... * function pointers...
*/ */
node-&gt;value.custom.data = dt; mxmlSetCustom(node, data, destroy);
node-&gt;value.custom.destroy = free;
/* /*
* Return with no errors... * Return with no errors...
@ -1095,6 +1173,8 @@ MXML_WS_BEFORE_CLOSE</TT>, or <TT>MXML_WS_AFTER_CLOSE</TT>. The callback
contain a <TT>void</TT> pointer to the allocated custom data for the contain a <TT>void</TT> pointer to the allocated custom data for the
node and a pointer to a destructor function which will free the custom node and a pointer to a destructor function which will free the custom
data when the node is deleted.</P> data when the node is deleted.</P>
<!-- NEED 15 -->
<P>The save callback receives the node pointer and returns an allocated <P>The save callback receives the node pointer and returns an allocated
string containing the custom data value. The following save callback string containing the custom data value. The following save callback
could be used for our ISO date/time type:</P> could be used for our ISO date/time type:</P>
@ -1106,7 +1186,7 @@ MXML_WS_BEFORE_CLOSE</TT>, or <TT>MXML_WS_AFTER_CLOSE</TT>. The callback
iso_date_time_t *dt; iso_date_time_t *dt;
dt = (iso_date_time_t *)node-&gt;custom.data; dt = (iso_date_time_t *)mxmlGetCustom(node);
snprintf(data, sizeof(data), snprintf(data, sizeof(data),
&quot;%04u-%02u-%02uT%02u:%02u:%02uZ&quot;, &quot;%04u-%02u-%02uT%02u:%02u:%02uZ&quot;,
@ -1297,7 +1377,7 @@ mxmlRetain</TT></A> function. For example, the following SAX callback
* Retain headings and titles... * Retain headings and titles...
*/ */
char *name = node-&gt;value.element.name; char *name = mxmlGetElement(node);
if (!strcmp(name, &quot;html&quot;) || if (!strcmp(name, &quot;html&quot;) ||
!strcmp(name, &quot;head&quot;) || !strcmp(name, &quot;head&quot;) ||
@ -1313,8 +1393,9 @@ mxmlRetain</TT></A> function. For example, the following SAX callback
} }
else if (event == MXML_SAX_DIRECTIVE) else if (event == MXML_SAX_DIRECTIVE)
mxmlRetain(node); mxmlRetain(node);
else if (event == MXML_SAX_DATA &amp;&amp; else if (event == MXML_SAX_DATA)
node-&gt;parent-&gt;ref_count &gt; 1) {
if (mxmlGetRefCount(mxmlGetParent(node)) &gt; 1)
{ {
/* /*
* If the parent was retained, then retain * If the parent was retained, then retain
@ -1324,6 +1405,7 @@ mxmlRetain</TT></A> function. For example, the following SAX callback
mxmlRetain(node); mxmlRetain(node);
} }
} }
}
</PRE> </PRE>
<P>The resulting skeleton document tree can then be searched just like <P>The resulting skeleton document tree can then be searched just like
one loaded using the <TT>mxmlLoad</TT> functions. For example, a filter one loaded using the <TT>mxmlLoad</TT> functions. For example, a filter
@ -1349,9 +1431,9 @@ mxmlRetain</TT></A> function. For example, the following SAX callback
if (body) if (body)
{ {
for (heading = body-&gt;child; for (heading = mxmlGetFirstChild(body);
heading; heading;
heading = heading-&gt;next) heading = mxmlGetNextSibling(heading))
print_children(heading); print_children(heading);
} }
</PRE> </PRE>
@ -1417,7 +1499,7 @@ hspace="10" src="4.gif" width="100"></A>Using the mxmldoc Utility</H1>
will document all public names it finds in your source files - any will document all public names it finds in your source files - any
names starting with the underscore character (_) or names that are names starting with the underscore character (_) or names that are
documented with the <A HREF="#ATDIRECTIVES">@private@</A> directive are documented with the <A HREF="#ATDIRECTIVES">@private@</A> directive are
treated as private and are undocumented.</P> treated as private and are not documented.</P>
<P>Comments appearing directly before a function or type definition are <P>Comments appearing directly before a function or type definition are
used to document that function or type. Comments appearing after used to document that function or type. Comments appearing after
argument, definition, return type, or variable declarations are used to argument, definition, return type, or variable declarations are used to
@ -1472,8 +1554,8 @@ hspace="10" src="4.gif" width="100"></A>Using the mxmldoc Utility</H1>
included in the documentation</LI> included in the documentation</LI>
<LI><TT>@since ...@</TT> - flags the item as new since a particular <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> 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 is highlighted in the generated documentation, e.g. <TT>@since Mini-XML
1.3@</TT>.</LI> 2.7@</TT>.</LI>
</UL> </UL>
<!-- NEED 10 --> <!-- NEED 10 -->
@ -1513,22 +1595,19 @@ hspace="10" src="A.gif" width="100"></A>Mini-XML License</H1>
<P>The Mini-XML library and included programs are provided under the <P>The Mini-XML library and included programs are provided under the
terms of the GNU Library General Public License version 2 (LGPL2) with terms of the GNU Library General Public License version 2 (LGPL2) with
the following exceptions:</P> the following exceptions:</P>
<OL> <P><B>1.</B> Static linking of applications to the Mini-XML library does
<LI>Static linking of applications to the Mini-XML library does not not constitute a derivative work and does not require the author to
constitute a derivative work and does not require the author to provide provide source code for the application, use the shared Mini-XML
source code for the application, use the shared Mini-XML libraries, or libraries, or link their applications against a user-supplied version
link their applications against a user-supplied version of Mini-XML. of Mini-XML.</P>
<P><I>If you link the application to a modified 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 then the changes to Mini-XML must be provided under the terms of the
LGPL2 in sections 1, 2, and 4.</I></P> LGPL2 in sections 1, 2, and 4.</I></P>
</LI> <P><B>2.</B> You do not have to provide a copy of the Mini-XML license
<LI>You do not have to provide a copy of the Mini-XML license with with programs that are linked to the Mini-XML library, nor do you have
programs that are linked to the Mini-XML library, nor do you have to to identify the Mini-XML license in your program or documentation as
identify the Mini-XML license in your program or documentation as required by section 6 of the LGPL2.</P>
required by section 6 of the LGPL2.</LI> <P>&nbsp;</P>
</OL>
<!-- NEW PAGE -->
<P align="center"><B>GNU LIBRARY GENERAL PUBLIC LICENSE</B></P> <P align="center"><B>GNU LIBRARY GENERAL PUBLIC LICENSE</B></P>
<P align="center">Version 2, June 1991 <P align="center">Version 2, June 1991
<BR> Copyright (C) 1991 Free Software Foundation, Inc. <BR> Copyright (C) 1991 Free Software Foundation, Inc.
@ -1947,9 +2026,12 @@ hspace="10" src="A.gif" width="100"></A>Mini-XML License</H1>
hspace="10" src="B.gif" width="100"></A>Release Notes</H1> hspace="10" src="B.gif" width="100"></A>Release Notes</H1>
<H2><A NAME="7_1">Changes in Mini-XML 2.7</A></H2> <H2><A NAME="7_1">Changes in Mini-XML 2.7</A></H2>
<UL> <UL>
<LI>Added data accessor (&quot;get&quot;) functions and made the mxml_node_t and
mxml_index_t structures private but still available in the Mini-XML
header to preserve source compatibility (STR #118)</LI>
<LI>Updated the source headers to reference the Mini-XML license and its <LI>Updated the source headers to reference the Mini-XML license and its
exceptions to the LGPL2 (STR #108)</LI> exceptions to the LGPL2 (STR #108)</LI>
<LI>Added a new mxmlFindValue() function to find the value node of a <LI>Added a new mxmlFindPath() function to find the value node of a
named element (STR #110)</LI> named element (STR #110)</LI>
<LI>Building a static version of the library did not work on Windows <LI>Building a static version of the library did not work on Windows
(STR #112)</LI> (STR #112)</LI>
@ -2261,8 +2343,8 @@ mxmlEntityGetValue</A></LI>
mxmlEntityRemoveCallback</A></LI> mxmlEntityRemoveCallback</A></LI>
<LI><A href="#mxmlFindElement" title="Find the named element."> <LI><A href="#mxmlFindElement" title="Find the named element.">
mxmlFindElement</A></LI> mxmlFindElement</A></LI>
<LI><A href="#mxmlFindValue" title="Find a value with the given path."> <LI><A href="#mxmlFindPath" title="Find a node with the given path.">
mxmlFindValue</A></LI> mxmlFindPath</A></LI>
<LI><A href="#mxmlGetCDATA" title="Get the value for a CDATA node."> <LI><A href="#mxmlGetCDATA" title="Get the value for a CDATA node.">
mxmlGetCDATA</A></LI> mxmlGetCDATA</A></LI>
<LI><A href="#mxmlGetCustom" title="Get the value for a custom node."> <LI><A href="#mxmlGetCustom" title="Get the value for a custom node.">
@ -2275,16 +2357,18 @@ mxmlGetFirstChild</A></LI>
mxmlGetInteger</A></LI> mxmlGetInteger</A></LI>
<LI><A href="#mxmlGetLastChild" title="Get the last child of an element node."> <LI><A href="#mxmlGetLastChild" title="Get the last child of an element node.">
mxmlGetLastChild</A></LI> mxmlGetLastChild</A></LI>
<LI><A href="#mxmlGetNext" title="Return the node type...">mxmlGetNext</A> <LI><A href="#mxmlGetNextSibling" title="Return the node type...">
</LI> mxmlGetNextSibling</A></LI>
<LI><A href="#mxmlGetOpaque" title="Get an opaque string value for a node or its first child."> <LI><A href="#mxmlGetOpaque" title="Get an opaque string value for a node or its first child.">
mxmlGetOpaque</A></LI> mxmlGetOpaque</A></LI>
<LI><A href="#mxmlGetParent" title="Get the parent node.">mxmlGetParent</A> <LI><A href="#mxmlGetParent" title="Get the parent node.">mxmlGetParent</A>
</LI> </LI>
<LI><A href="#mxmlGetPrevious" title="Get the previous node for the current parent."> <LI><A href="#mxmlGetPrevSibling" title="Get the previous node for the current parent.">
mxmlGetPrevious</A></LI> mxmlGetPrevSibling</A></LI>
<LI><A href="#mxmlGetReal" title="Get the real value for a node or its first child."> <LI><A href="#mxmlGetReal" title="Get the real value for a node or its first child.">
mxmlGetReal</A></LI> 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."> <LI><A href="#mxmlGetText" title="Get the text value for a node or its first child.">
mxmlGetText</A></LI> mxmlGetText</A></LI>
<LI><A href="#mxmlGetType" title="Get the node type.">mxmlGetType</A></LI> <LI><A href="#mxmlGetType" title="Get the node type.">mxmlGetType</A></LI>
@ -2624,9 +2708,9 @@ mxmlEntityRemoveCallback</A></H3>
children.</P> children.</P>
<H3 class="function"><A NAME="8_2_12"> <H3 class="function"><A NAME="8_2_12">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlFindValue">mxmlFindValue</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlFindPath">mxmlFindPath</A></A></H3>
<P class="description">Find a value with the given path.</P> <P class="description">Find a node with the given path.</P>
<P class="code"> <A href="#mxml_node_t">mxml_node_t</A> *mxmlFindValue ( <P class="code"> <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;<A href="#mxml_node_t">mxml_node_t</A> *top,
<BR> &nbsp;&nbsp;&nbsp;&nbsp;const char *path <BR> &nbsp;&nbsp;&nbsp;&nbsp;const char *path
<BR> );</P> <BR> );</P>
@ -2638,17 +2722,20 @@ mxmlEntityRemoveCallback</A></H3>
<DD class="description">Path to element</DD> <DD class="description">Path to element</DD>
</DL> </DL>
<H4 class="returnvalue">Return Value</H4> <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> <H4 class="discussion">Discussion</H4>
<P class="discussion">The &quot;path&quot; is a slash-separated list of element <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 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 elements. For example, &quot;foo/one/two&quot;, &quot;bar/two/one&quot;, &quot;*/one&quot;, and so
forth.</P> 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"><A NAME="8_2_13"> <H3 class="function"><A NAME="8_2_13">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetCDATA">mxmlGetCDATA</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetCDATA">mxmlGetCDATA</A></A></H3>
<P class="description">Get the value for a CDATA node.</P> <P class="description">Get the value for a CDATA node.</P>
<P class="code"> char *mxmlGetCDATA ( <P class="code"> const char *mxmlGetCDATA (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P> <BR> );</P>
<H4 class="parameters">Parameters</H4> <H4 class="parameters">Parameters</H4>
@ -2665,7 +2752,7 @@ mxmlEntityRemoveCallback</A></H3>
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetCustom">mxmlGetCustom</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetCustom">mxmlGetCustom</A></A></H3>
<P class="description">Get the value for a custom node.</P> <P class="description">Get the value for a custom node.</P>
<P class="code"> void *mxmlGetCustom ( <P class="code"> const void *mxmlGetCustom (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P> <BR> );</P>
<H4 class="parameters">Parameters</H4> <H4 class="parameters">Parameters</H4>
@ -2682,7 +2769,7 @@ mxmlEntityRemoveCallback</A></H3>
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetElement">mxmlGetElement</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetElement">mxmlGetElement</A></A></H3>
<P class="description">Get the name for an element node.</P> <P class="description">Get the name for an element node.</P>
<P class="code"> char *mxmlGetElement ( <P class="code"> const char *mxmlGetElement (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P> <BR> );</P>
<H4 class="parameters">Parameters</H4> <H4 class="parameters">Parameters</H4>
@ -2749,9 +2836,10 @@ mxmlEntityRemoveCallback</A></H3>
<H4 class="discussion">Discussion</H4> <H4 class="discussion">Discussion</H4>
<P class="discussion"><CODE>NULL</CODE> is returned if the node is not <P class="discussion"><CODE>NULL</CODE> is returned if the node is not
an element node or if the node has no children.</P> an element node or if the node has no children.</P>
<H3 class="function"><A name="mxmlGetNext">mxmlGetNext</A></H3> <H3 class="function"><A name="mxmlGetNextSibling">mxmlGetNextSibling</A></H3>
<P class="description">Return the node type...</P> <P class="description">Return the node type...</P>
<P class="code"> <A href="#mxml_node_t">mxml_node_t</A> *mxmlGetNext ( <P class="code"> <A href="#mxml_node_t">mxml_node_t</A>
*mxmlGetNextSibling (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P> <BR> );</P>
<H4 class="parameters">Parameters</H4> <H4 class="parameters">Parameters</H4>
@ -2768,7 +2856,7 @@ mxmlEntityRemoveCallback</A></H3>
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetOpaque">mxmlGetOpaque</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetOpaque">mxmlGetOpaque</A></A></H3>
<P class="description">Get an opaque string value for a node or its <P class="description">Get an opaque string value for a node or its
first child.</P> first child.</P>
<P class="code"> char *mxmlGetOpaque ( <P class="code"> const char *mxmlGetOpaque (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P> <BR> );</P>
<H4 class="parameters">Parameters</H4> <H4 class="parameters">Parameters</H4>
@ -2799,10 +2887,10 @@ mxmlEntityRemoveCallback</A></H3>
<P class="discussion"><CODE>NULL</CODE> is returned for a root node.</P> <P class="discussion"><CODE>NULL</CODE> is returned for a root node.</P>
<H3 class="function"><A NAME="8_2_22"> <H3 class="function"><A NAME="8_2_22">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetPrevious">mxmlGetPrevious</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetPrevSibling">mxmlGetPrevSibling</A></A></H3>
<P class="description">Get the previous node for the current parent.</P> <P class="description">Get the previous node for the current parent.</P>
<P class="code"> <A href="#mxml_node_t">mxml_node_t</A> *mxmlGetPrevious <P class="code"> <A href="#mxml_node_t">mxml_node_t</A>
( *mxmlGetPrevSibling (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P> <BR> );</P>
<H4 class="parameters">Parameters</H4> <H4 class="parameters">Parameters</H4>
@ -2834,9 +2922,28 @@ mxmlEntityRemoveCallback</A></H3>
is not a real value node.</P> is not a real value node.</P>
<H3 class="function"><A NAME="8_2_24"> <H3 class="function"><A NAME="8_2_24">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetRefCount">mxmlGetRefCount</A></A></H3>
<P class="description">Get the current reference (use) count for a node.</P>
<P class="code"> int mxmlGetRefCount (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node
<BR> );</P>
<H4 class="parameters">Parameters</H4>
<DL>
<DT>node</DT>
<DD class="description">Node</DD>
</DL>
<H4 class="returnvalue">Return Value</H4>
<P class="description">Reference count</P>
<H4 class="discussion">Discussion</H4>
<P class="discussion">The initial reference count of new nodes is 1. Use
the <A href="#mxmlRetain"><CODE>mxmlRetain</CODE></A> and <A href="#mxmlRelease">
<CODE>mxmlRelease</CODE></A> functions to increment and decrement a
node's reference count. .</P>
<H3 class="function"><A NAME="8_2_25">
<!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetText">mxmlGetText</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetText">mxmlGetText</A></A></H3>
<P class="description">Get the text value for a node or its first child.</P> <P class="description">Get the text value for a node or its first child.</P>
<P class="code"> char *mxmlGetText ( <P class="code"> const char *mxmlGetText (
<BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node, <BR> &nbsp;&nbsp;&nbsp;&nbsp;<A href="#mxml_node_t">mxml_node_t</A> *node,
<BR> &nbsp;&nbsp;&nbsp;&nbsp;int *whitespace <BR> &nbsp;&nbsp;&nbsp;&nbsp;int *whitespace
<BR> );</P> <BR> );</P>
@ -2853,7 +2960,7 @@ mxmlEntityRemoveCallback</A></H3>
<H4 class="discussion">Discussion</H4> <H4 class="discussion">Discussion</H4>
<P class="discussion"><CODE>NULL</CODE> is returned if the node (or its <P class="discussion"><CODE>NULL</CODE> is returned if the node (or its
first child) is not a text node. The &quot;whitespace&quot; argument can be NULL.</P> first child) is not a text node. The &quot;whitespace&quot; argument can be NULL.</P>
<H3 class="function"><A NAME="8_2_25"> <H3 class="function"><A NAME="8_2_26">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetType">mxmlGetType</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetType">mxmlGetType</A></A></H3>
<P class="description">Get the node type.</P> <P class="description">Get the node type.</P>
@ -2870,7 +2977,7 @@ mxmlEntityRemoveCallback</A></H3>
<H4 class="discussion">Discussion</H4> <H4 class="discussion">Discussion</H4>
<P class="discussion"><CODE>MXML_IGNORE</CODE> is returned if &quot;node&quot; is <CODE> <P class="discussion"><CODE>MXML_IGNORE</CODE> is returned if &quot;node&quot; is <CODE>
NULL</CODE>.</P> NULL</CODE>.</P>
<H3 class="function"><A NAME="8_2_26"> <H3 class="function"><A NAME="8_2_27">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetUserData">mxmlGetUserData</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlGetUserData">mxmlGetUserData</A></A></H3>
<P class="description">Get the user data pointer for a node.</P> <P class="description">Get the user data pointer for a node.</P>
@ -2932,7 +3039,7 @@ NULL</CODE>.</P>
this function for the first time with a particular set of &quot;element&quot; and this function for the first time with a particular set of &quot;element&quot; and
&quot;value&quot; strings. Passing NULL for both &quot;element&quot; and &quot;value&quot; is &quot;value&quot; strings. Passing NULL for both &quot;element&quot; and &quot;value&quot; is
equivalent to calling mxmlIndexEnum().</P> equivalent to calling mxmlIndexEnum().</P>
<H3 class="function"><A NAME="8_2_30"> <H3 class="function"><A NAME="8_2_31">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlIndexGetCount">mxmlIndexGetCount</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlIndexGetCount">mxmlIndexGetCount</A></A></H3>
<P class="description">Get the number of nodes in an index.</P> <P class="description">Get the number of nodes in an index.</P>
@ -3076,7 +3183,7 @@ NULL</CODE>.</P>
<BR> The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK, <BR> The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,
MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading
child nodes of the specified type.</P> child nodes of the specified type.</P>
<H3 class="function"><A NAME="8_2_36"> <H3 class="function"><A NAME="8_2_37">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlNewCDATA">mxmlNewCDATA</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlNewCDATA">mxmlNewCDATA</A></A></H3>
<P class="description">Create a new CDATA node.</P> <P class="description">Create a new CDATA node.</P>
@ -3099,7 +3206,7 @@ NULL</CODE>.</P>
to specify that the new CDATA node has no parent. The data string must 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 be nul-terminated and is copied into the new node. CDATA nodes use the
MXML_ELEMENT type.</P> MXML_ELEMENT type.</P>
<H3 class="function"><A NAME="8_2_37"> <H3 class="function"><A NAME="8_2_38">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.1&nbsp;<A name="mxmlNewCustom">mxmlNewCustom</A></A></H3> &nbsp;Mini-XML 2.1&nbsp;<A name="mxmlNewCustom">mxmlNewCustom</A></A></H3>
<P class="description">Create a new custom data node.</P> <P class="description">Create a new custom data node.</P>
@ -3258,7 +3365,7 @@ NULL</CODE>.</P>
parameter is used to specify whether leading whitespace is present parameter is used to specify whether leading whitespace is present
before the node. The format string must be nul-terminated and is before the node. The format string must be nul-terminated and is
formatted into the new node.</P> formatted into the new node.</P>
<H3 class="function"><A NAME="8_2_44"> <H3 class="function"><A NAME="8_2_45">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlNewXML">mxmlNewXML</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlNewXML">mxmlNewXML</A></A></H3>
<P class="description">Create a new XML document tree.</P> <P class="description">Create a new XML document tree.</P>
@ -3276,7 +3383,7 @@ NULL</CODE>.</P>
<P class="discussion">The &quot;version&quot; argument specifies the version <P class="discussion">The &quot;version&quot; argument specifies the version
number to put in the ?xml element node. If NULL, version 1.0 is number to put in the ?xml element node. If NULL, version 1.0 is
assumed.</P> assumed.</P>
<H3 class="function"><A NAME="8_2_45"> <H3 class="function"><A NAME="8_2_46">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlRelease">mxmlRelease</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlRelease">mxmlRelease</A></A></H3>
<P class="description">Release a node.</P> <P class="description">Release a node.</P>
@ -3307,7 +3414,7 @@ NULL</CODE>.</P>
<P class="discussion">Does not free memory used by the node - use <P class="discussion">Does not free memory used by the node - use
mxmlDelete() for that. This function does nothing if the node has no mxmlDelete() for that. This function does nothing if the node has no
parent.</P> parent.</P>
<H3 class="function"><A NAME="8_2_47"> <H3 class="function"><A NAME="8_2_48">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlRetain">mxmlRetain</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlRetain">mxmlRetain</A></A></H3>
<P class="description">Retain a node.</P> <P class="description">Retain a node.</P>
@ -3321,7 +3428,7 @@ NULL</CODE>.</P>
</DL> </DL>
<H4 class="returnvalue">Return Value</H4> <H4 class="returnvalue">Return Value</H4>
<P class="description">New reference count</P> <P class="description">New reference count</P>
<H3 class="function"><A NAME="8_2_48"> <H3 class="function"><A NAME="8_2_49">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSAXLoadFd">mxmlSAXLoadFd</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSAXLoadFd">mxmlSAXLoadFd</A></A></H3>
<P class="description">Load a file descriptor into an XML node tree <P class="description">Load a file descriptor into an XML node tree
@ -3363,7 +3470,7 @@ NULL</CODE>.</P>
<BR> The SAX callback must call mxmlRetain() for any nodes that need to <BR> The SAX callback must call mxmlRetain() for any nodes that need to
be kept for later use. Otherwise, nodes are deleted when the parent be kept for later use. Otherwise, nodes are deleted when the parent
node is closed or after each data, comment, CDATA, or directive node.</P> node is closed or after each data, comment, CDATA, or directive node.</P>
<H3 class="function"><A NAME="8_2_49"> <H3 class="function"><A NAME="8_2_50">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSAXLoadFile">mxmlSAXLoadFile</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSAXLoadFile">mxmlSAXLoadFile</A></A></H3>
<P class="description">Load a file into an XML node tree using a SAX <P class="description">Load a file into an XML node tree using a SAX
@ -3406,7 +3513,7 @@ NULL</CODE>.</P>
<BR> The SAX callback must call mxmlRetain() for any nodes that need to <BR> The SAX callback must call mxmlRetain() for any nodes that need to
be kept for later use. Otherwise, nodes are deleted when the parent be kept for later use. Otherwise, nodes are deleted when the parent
node is closed or after each data, comment, CDATA, or directive node.</P> node is closed or after each data, comment, CDATA, or directive node.</P>
<H3 class="function"><A NAME="8_2_50"> <H3 class="function"><A NAME="8_2_51">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSAXLoadString">mxmlSAXLoadString</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSAXLoadString">mxmlSAXLoadString</A></A></H3>
<P class="description">Load a string into an XML node tree using a SAX <P class="description">Load a string into an XML node tree using a SAX
@ -3556,7 +3663,7 @@ NULL</CODE>.</P>
MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_NO_CALLBACK is specified, whitespace will only be added before
MXML_TEXT nodes with leading whitespace and before attribute names MXML_TEXT nodes with leading whitespace and before attribute names
inside opening element tags.</P> inside opening element tags.</P>
<H3 class="function"><A NAME="8_2_55"> <H3 class="function"><A NAME="8_2_56">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSetCDATA">mxmlSetCDATA</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSetCDATA">mxmlSetCDATA</A></A></H3>
<P class="description">Set the element name of a CDATA node.</P> <P class="description">Set the element name of a CDATA node.</P>
@ -3576,7 +3683,7 @@ NULL</CODE>.</P>
<H4 class="discussion">Discussion</H4> <H4 class="discussion">Discussion</H4>
<P class="discussion">The node is not changed if it is not a CDATA <P class="discussion">The node is not changed if it is not a CDATA
element node.</P> element node.</P>
<H3 class="function"><A NAME="8_2_56"> <H3 class="function"><A NAME="8_2_57">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.1&nbsp;<A name="mxmlSetCustom">mxmlSetCustom</A></A></H3> &nbsp;Mini-XML 2.1&nbsp;<A name="mxmlSetCustom">mxmlSetCustom</A></A></H3>
<P class="description">Set the data and destructor of a custom data <P class="description">Set the data and destructor of a custom data
@ -3749,7 +3856,7 @@ mxmlSetCustomHandlers</A></H3>
<P class="description">0 on success, -1 on failure</P> <P class="description">0 on success, -1 on failure</P>
<H4 class="discussion">Discussion</H4> <H4 class="discussion">Discussion</H4>
<P class="discussion">The node is not changed if it is not a text node.</P> <P class="discussion">The node is not changed if it is not a text node.</P>
<H3 class="function"><A NAME="8_2_65"> <H3 class="function"><A NAME="8_2_66">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.7&nbsp;<A name="mxmlSetUserData">mxmlSetUserData</A></A></H3> &nbsp;Mini-XML 2.7&nbsp;<A name="mxmlSetUserData">mxmlSetUserData</A></A></H3>
<P class="description">Set the user data pointer for a node.</P> <P class="description">Set the user data pointer for a node.</P>
@ -3766,7 +3873,7 @@ mxmlSetCustomHandlers</A></H3>
</DL> </DL>
<H4 class="returnvalue">Return Value</H4> <H4 class="returnvalue">Return Value</H4>
<P class="description">0 on success, -1 on failure</P> <P class="description">0 on success, -1 on failure</P>
<H3 class="function"><A NAME="8_2_66"> <H3 class="function"><A NAME="8_2_67">
<!--span class=&quot;info&quot;--> <!--span class=&quot;info&quot;-->
&nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSetWrapMargin">mxmlSetWrapMargin</A></A></H3> &nbsp;Mini-XML 2.3&nbsp;<A name="mxmlSetWrapMargin">mxmlSetWrapMargin</A></A></H3>
<P class="description">Set the wrap margin when saving XML data.</P> <P class="description">Set the wrap margin when saving XML data.</P>
@ -3923,7 +4030,7 @@ hspace="10" src="D.gif" width="100"></A>XML Schema</H1>
<P>This appendix provides the XML schema that is used for the XML files <P>This appendix provides the XML schema that is used for the XML files
produced by <TT>mxmldoc</TT>. This schema is available on-line at:</P> produced by <TT>mxmldoc</TT>. This schema is available on-line at:</P>
<PRE> <PRE>
http://www.easysw.com/~mike/mxmldoc.xsd http://www.minixml.org/mxmldoc.xsd
</PRE> </PRE>
<H2><A NAME="9_1">mxmldoc.xsd</A></H2> <H2><A NAME="9_1">mxmldoc.xsd</A></H2>
<PRE><SMALL> <PRE><SMALL>
@ -3931,8 +4038,8 @@ hspace="10" src="D.gif" width="100"></A>XML Schema</H1>
&lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt; &lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
&lt;xsd:annotation&gt; &lt;xsd:annotation&gt;
&lt;xsd:documentation xml:lang=&quot;en&quot;&gt; &lt;xsd:documentation xml:lang=&quot;en&quot;&gt;
Mini-XML 2.3 documentation schema for mxmldoc output. Mini-XML 2.7 documentation schema for mxmldoc output.
Copyright 2003-2007 by Michael Sweet. Copyright 2003-2011 by Michael Sweet.
&lt;/xsd:documentation&gt; &lt;/xsd:documentation&gt;
&lt;/xsd:annotation&gt; &lt;/xsd:annotation&gt;

@ -88,7 +88,7 @@ to describe the functions, types, and constants in your code.
source files - any names starting with the underscore character (_) source files - any names starting with the underscore character (_)
or names that are documented with the <A or names that are documented with the <A
HREF="#ATDIRECTIVES">@private@</A> directive are treated as private 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 <p>Comments appearing directly before a function or type definition
are used to document that function or type. Comments appearing after 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 <li><tt>@since ...@</tt> - flags the item as new since a
particular release. The text following the <tt>@since</tt> particular release. The text following the <tt>@since</tt>
up to the closing <tt>@</tt> is highlighted in the generated 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> </ul>

@ -2,8 +2,8 @@
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation> <xsd:annotation>
<xsd:documentation xml:lang="en"> <xsd:documentation xml:lang="en">
Mini-XML 2.3 documentation schema for mxmldoc output. Mini-XML 2.7 documentation schema for mxmldoc output.
Copyright 2003-2007 by Michael Sweet. Copyright 2003-2011 by Michael Sweet.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public 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="#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="#mxmlEntityRemoveCallback" title="Remove a callback.">mxmlEntityRemoveCallback</a></li>
<li><a href="#mxmlFindElement" title="Find the named element.">mxmlFindElement</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="#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="#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> <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 <li><a href="#mxmlGetInteger" title="Get the integer value from the specified node or its
first child.">mxmlGetInteger</a></li> first child.">mxmlGetInteger</a></li>
<li><a href="#mxmlGetLastChild" title="Get the last child of an element node.">mxmlGetLastChild</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="#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="#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="#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="#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="#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> <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 MXML_DESCEND_FIRST for the initial search and MXML_NO_DESCEND to find
additional direct descendents of the node. The top node argument additional direct descendents of the node. The top node argument
constrains the search to a particular node's children.</p> 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> <h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlFindPath">mxmlFindPath</a></h3>
<p class="description">Find a value with the given path.</p> <p class="description">Find a node with the given path.</p>
<p class="code"> <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;<a href="#mxml_node_t">mxml_node_t</a> *top,<br>
&nbsp;&nbsp;&nbsp;&nbsp;const char *path<br> &nbsp;&nbsp;&nbsp;&nbsp;const char *path<br>
);</p> );</p>
@ -467,17 +468,20 @@ constrains the search to a particular node's children.</p>
<dd class="description">Path to element</dd> <dd class="description">Path to element</dd>
</dl> </dl>
<h4 class="returnvalue">Return Value</h4> <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> <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 <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, 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> </p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetCDATA">mxmlGetCDATA</a></h3> <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="description">Get the value for a CDATA node.</p>
<p class="code"> <p class="code">
char *mxmlGetCDATA (<br> const char *mxmlGetCDATA (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p> );</p>
<h4 class="parameters">Parameters</h4> <h4 class="parameters">Parameters</h4>
@ -494,7 +498,7 @@ char *mxmlGetCDATA (<br>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetCustom">mxmlGetCustom</a></h3> <h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetCustom">mxmlGetCustom</a></h3>
<p class="description">Get the value for a custom node.</p> <p class="description">Get the value for a custom node.</p>
<p class="code"> <p class="code">
void *mxmlGetCustom (<br> const void *mxmlGetCustom (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p> );</p>
<h4 class="parameters">Parameters</h4> <h4 class="parameters">Parameters</h4>
@ -512,7 +516,7 @@ value node.
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetElement">mxmlGetElement</a></h3> <h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetElement">mxmlGetElement</a></h3>
<p class="description">Get the name for an element node.</p> <p class="description">Get the name for an element node.</p>
<p class="code"> <p class="code">
char *mxmlGetElement (<br> const char *mxmlGetElement (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p> );</p>
<h4 class="parameters">Parameters</h4> <h4 class="parameters">Parameters</h4>
@ -580,10 +584,10 @@ int mxmlGetInteger (<br>
has no children. has no children.
</p> </p>
<h3 class="function"><a name="mxmlGetNext">mxmlGetNext</a></h3> <h3 class="function"><a name="mxmlGetNextSibling">mxmlGetNextSibling</a></h3>
<p class="description">Return the node type...</p> <p class="description">Return the node type...</p>
<p class="code"> <p class="code">
<a href="#mxml_node_t">mxml_node_t</a> *mxmlGetNext (<br> <a href="#mxml_node_t">mxml_node_t</a> *mxmlGetNextSibling (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p> );</p>
<h4 class="parameters">Parameters</h4> <h4 class="parameters">Parameters</h4>
@ -599,7 +603,7 @@ has no children.
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetOpaque">mxmlGetOpaque</a></h3> <h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetOpaque">mxmlGetOpaque</a></h3>
<p class="description">Get an opaque string value for a node or its first child.</p> <p class="description">Get an opaque string value for a node or its first child.</p>
<p class="code"> <p class="code">
char *mxmlGetOpaque (<br> const char *mxmlGetOpaque (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p> );</p>
<h4 class="parameters">Parameters</h4> <h4 class="parameters">Parameters</h4>
@ -631,10 +635,10 @@ value node.
<p class="discussion"><code>NULL</code> is returned for a root node. <p class="discussion"><code>NULL</code> is returned for a root node.
</p> </p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetPrevious">mxmlGetPrevious</a></h3> <h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetPrevSibling">mxmlGetPrevSibling</a></h3>
<p class="description">Get the previous node for the current parent.</p> <p class="description">Get the previous node for the current parent.</p>
<p class="code"> <p class="code">
<a href="#mxml_node_t">mxml_node_t</a> *mxmlGetPrevious (<br> <a href="#mxml_node_t">mxml_node_t</a> *mxmlGetPrevSibling (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p> );</p>
<h4 class="parameters">Parameters</h4> <h4 class="parameters">Parameters</h4>
@ -665,10 +669,29 @@ double mxmlGetReal (<br>
<p class="discussion">0.0 is returned if the node (or its first child) is not a real value node. <p class="discussion">0.0 is returned if the node (or its first child) is not a real value node.
</p> </p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetRefCount">mxmlGetRefCount</a></h3>
<p class="description">Get the current reference (use) count for a node.</p>
<p class="code">
int mxmlGetRefCount (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node<br>
);</p>
<h4 class="parameters">Parameters</h4>
<dl>
<dt>node</dt>
<dd class="description">Node</dd>
</dl>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Reference count</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The initial reference count of new nodes is 1. Use the <a href="#mxmlRetain"><code>mxmlRetain</code></a>
and <a href="#mxmlRelease"><code>mxmlRelease</code></a> functions to increment and decrement a node's
reference count.
.</p>
<h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetText">mxmlGetText</a></h3> <h3 class="function"><span class="info">&nbsp;Mini-XML 2.7&nbsp;</span><a name="mxmlGetText">mxmlGetText</a></h3>
<p class="description">Get the text value for a node or its first child.</p> <p class="description">Get the text value for a node or its first child.</p>
<p class="code"> <p class="code">
char *mxmlGetText (<br> const char *mxmlGetText (<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node,<br> &nbsp;&nbsp;&nbsp;&nbsp;<a href="#mxml_node_t">mxml_node_t</a> *node,<br>
&nbsp;&nbsp;&nbsp;&nbsp;int *whitespace<br> &nbsp;&nbsp;&nbsp;&nbsp;int *whitespace<br>
);</p> );</p>

@ -9,10 +9,14 @@ hspace="10" width="100" height="100" alt="B"></a>Release Notes</h1>
<ul> <ul>
<li>Added data accessor ("get") functions and made the mxml_node_t and
mxml_index_t structures private but still available in the Mini-XML
header to preserve source compatibility (STR #118)</li>
<li>Updated the source headers to reference the Mini-XML license and its <li>Updated the source headers to reference the Mini-XML license and its
exceptions to the LGPL2 (STR #108)</li> exceptions to the LGPL2 (STR #108)</li>
<li>Added a new mxmlFindValue() function to find the value node of a <li>Added a new mxmlFindPath() function to find the value node of a
named element (STR #110)</li> named element (STR #110)</li>
<li>Building a static version of the library did not work on Windows <li>Building a static version of the library did not work on Windows

@ -9,7 +9,7 @@ files produced by <tt>mxmldoc</tt>. This schema is available on-line
at:</p> at:</p>
<pre> <pre>
http://www.easysw.com/~mike/mxmldoc.xsd http://www.minixml.org/mxmldoc.xsd
</pre> </pre>
<h2 _hd_omit_toc>mxmldoc.xsd</h2> <h2 _hd_omit_toc>mxmldoc.xsd</h2>
@ -19,8 +19,8 @@ at:</p>
&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
&lt;xsd:annotation> &lt;xsd:annotation>
&lt;xsd:documentation xml:lang="en"> &lt;xsd:documentation xml:lang="en">
Mini-XML 2.3 documentation schema for mxmldoc output. Mini-XML 2.7 documentation schema for mxmldoc output.
Copyright 2003-2007 by Michael Sweet. Copyright 2003-2011 by Michael Sweet.
&lt;/xsd:documentation> &lt;/xsd:documentation>
&lt;/xsd:annotation> &lt;/xsd:annotation>

@ -22,11 +22,11 @@
* mxmlGetInteger() - Get the integer value from the specified node or its * mxmlGetInteger() - Get the integer value from the specified node or its
* first child. * first child.
* mxmlGetLastChild() - Get the last child of an element node. * mxmlGetLastChild() - Get the last child of an element node.
* mxmlGetNext() - Get the next node for the current parent. * mxmlGetNextSibling() - Get the next node for the current parent.
* mxmlGetOpaque() - Get an opaque string value for a node or its first * mxmlGetOpaque() - Get an opaque string value for a node or its first
* child. * child.
* mxmlGetParent() - Get the parent node. * mxmlGetParent() - Get the parent node.
* mxmlGetPrevious() - Get the previous node for the current parent. * mxmlGetPrevSibling() - Get the previous node for the current parent.
* mxmlGetReal() - Get the real value for a node or its first child. * mxmlGetReal() - Get the real value for a node or its first child.
* mxmlGetText() - Get the text value for a node or its first child. * mxmlGetText() - Get the text value for a node or its first child.
* mxmlGetType() - Get the node type. * mxmlGetType() - Get the node type.
@ -49,7 +49,7 @@
* @since Mini-XML 2.7@ * @since Mini-XML 2.7@
*/ */
char * /* O - CDATA value or NULL */ const char * /* O - CDATA value or NULL */
mxmlGetCDATA(mxml_node_t *node) /* I - Node to get */ mxmlGetCDATA(mxml_node_t *node) /* I - Node to get */
{ {
/* /*
@ -77,7 +77,7 @@ mxmlGetCDATA(mxml_node_t *node) /* I - Node to get */
* @since Mini-XML 2.7@ * @since Mini-XML 2.7@
*/ */
void * /* O - Custom value or NULL */ const void * /* O - Custom value or NULL */
mxmlGetCustom(mxml_node_t *node) /* I - Node to get */ mxmlGetCustom(mxml_node_t *node) /* I - Node to get */
{ {
/* /*
@ -110,7 +110,7 @@ mxmlGetCustom(mxml_node_t *node) /* I - Node to get */
* @since Mini-XML 2.7@ * @since Mini-XML 2.7@
*/ */
char * /* O - Element name or NULL */ const char * /* O - Element name or NULL */
mxmlGetElement(mxml_node_t *node) /* I - Node to get */ mxmlGetElement(mxml_node_t *node) /* I - Node to get */
{ {
/* /*
@ -217,7 +217,7 @@ mxmlGetLastChild(mxml_node_t *node) /* I - Node to get */
/* /*
* 'mxmlGetNext()' - Get the next node for the current parent. * 'mxmlGetNextSibling()' - Get the next node for the current parent.
* *
* @code NULL@ is returned if this is the last child for the current parent. * @code NULL@ is returned if this is the last child for the current parent.
* *
@ -225,7 +225,7 @@ mxmlGetLastChild(mxml_node_t *node) /* I - Node to get */
*/ */
mxml_node_t * mxml_node_t *
mxmlGetNext(mxml_node_t *node) /* I - Node to get */ mxmlGetNextSibling(mxml_node_t *node) /* I - Node to get */
{ {
/* /*
* Range check input... * Range check input...
@ -251,7 +251,7 @@ mxmlGetNext(mxml_node_t *node) /* I - Node to get */
* @since Mini-XML 2.7@ * @since Mini-XML 2.7@
*/ */
char * /* O - Opaque string or NULL */ const char * /* O - Opaque string or NULL */
mxmlGetOpaque(mxml_node_t *node) /* I - Node to get */ mxmlGetOpaque(mxml_node_t *node) /* I - Node to get */
{ {
/* /*
@ -303,7 +303,7 @@ mxmlGetParent(mxml_node_t *node) /* I - Node to get */
/* /*
* 'mxmlGetPrevious()' - Get the previous node for the current parent. * 'mxmlGetPrevSibling()' - Get the previous node for the current parent.
* *
* @code NULL@ is returned if this is the first child for the current parent. * @code NULL@ is returned if this is the first child for the current parent.
* *
@ -311,7 +311,7 @@ mxmlGetParent(mxml_node_t *node) /* I - Node to get */
*/ */
mxml_node_t * /* O - Previous node or NULL */ mxml_node_t * /* O - Previous node or NULL */
mxmlGetPrevious(mxml_node_t *node) /* I - Node to get */ mxmlGetPrevSibling(mxml_node_t *node) /* I - Node to get */
{ {
/* /*
* Range check input... * Range check input...
@ -370,7 +370,7 @@ mxmlGetReal(mxml_node_t *node) /* I - Node to get */
* @since Mini-XML 2.7@ * @since Mini-XML 2.7@
*/ */
char * /* O - Text string or NULL */ const char * /* O - Text string or NULL */
mxmlGetText(mxml_node_t *node, /* I - Node to get */ mxmlGetText(mxml_node_t *node, /* I - Node to get */
int *whitespace) /* O - 1 if string is preceded by whitespace, 0 otherwise */ int *whitespace) /* O - 1 if string is preceded by whitespace, 0 otherwise */
{ {

@ -3,7 +3,7 @@
* *
* 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-2010 by Michael R Sweet. * Copyright 2003-2011 by Michael R Sweet.
* *
* These coded instructions, statements, and computer programs are the * These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright * property of Michael R Sweet and are protected by Federal copyright
@ -15,21 +15,6 @@
* *
* Contents: * Contents:
* *
* mxmlAdd() - Add a node to a tree.
* mxmlDelete() - Delete a node and all of its children.
* mxmlNewCDATA() - Create a new CDATA node.
* mxmlNewCustom() - Create a new custom data node.
* mxmlNewElement() - Create a new element node.
* mxmlNewInteger() - Create a new integer node.
* mxmlNewOpaque() - Create a new opaque string.
* mxmlNewReal() - Create a new real number node.
* mxmlNewText() - Create a new text fragment node.
* mxmlNewTextf() - Create a new formatted text fragment node.
* mxmlNewXML() - Create a new XML document tree.
* mxmlRelease() - Release a node.
* mxmlRemove() - Remove a node from its parent.
* mxmlRetain() - Retain a node.
* mxml_new() - Create a new node.
*/ */
/* /*
@ -276,6 +261,34 @@ mxmlDelete(mxml_node_t *node) /* I - Node to delete */
} }
/*
* 'mxmlGetRefCount()' - Get the current reference (use) count for a node.
*
* The initial reference count of new nodes is 1. Use the @link mxmlRetain@
* and @link mxmlRelease@ functions to increment and decrement a node's
* reference count.
*
* @since Mini-XML 2.7@.
*/
int /* O - Reference count */
mxmlGetRefCount(mxml_node_t *node) /* I - Node */
{
/*
* Range check input...
*/
if (!node)
return (0);
/*
* Return the reference count...
*/
return (node->ref_count);
}
/* /*
* 'mxmlNewCDATA()' - Create a new CDATA node. * 'mxmlNewCDATA()' - Create a new CDATA node.
* *

@ -118,22 +118,25 @@ mxmlFindElement(mxml_node_t *node, /* I - Current node */
/* /*
* 'mxmlFindValue()' - Find a value with the given path. * 'mxmlFindPath()' - Find a node with the given path.
* *
* The "path" is a slash-separated list of element names. The name "*" is * The "path" is a slash-separated list of element names. The name "*" is
* considered a wildcard for one or more levels of elements. For example, * considered a wildcard for one or more levels of elements. For example,
* "foo/one/two", "bar/two/one", "*\/one", and so forth. * "foo/one/two", "bar/two/one", "*\/one", and so forth.
* *
* The first child node of the found node is returned if the given node has
* children and the first child is a value node.
*
* @since Mini-XML 2.7@ * @since Mini-XML 2.7@
*/ */
mxml_node_t * /* O - First value node or NULL */ mxml_node_t * /* O - Found node or NULL */
mxmlFindValue(mxml_node_t *top, /* I - Top node */ mxmlFindPath(mxml_node_t *top, /* I - Top node */
const char *path) /* I - Path to element */ const char *path) /* I - Path to element */
{ {
mxml_node_t *node; /* Current node */ mxml_node_t *node; /* Current node */
char element[256], /* Current element name */ char element[256]; /* Current element name */
*pathsep; /* Separator in path */ const char *pathsep; /* Separator in path */
int descend; /* mxmlFindElement option */ int descend; /* mxmlFindElement option */
@ -191,10 +194,13 @@ mxmlFindValue(mxml_node_t *top, /* I - Top node */
} }
/* /*
* If we get this far, return the first child of the current node... * If we get this far, return the node or its first child...
*/ */
if (node->child && node->child->type != MXML_ELEMENT)
return (node->child); return (node->child);
else
return (node);
} }

@ -210,19 +210,20 @@ extern void mxmlEntityRemoveCallback(mxml_entity_cb_t cb);
extern mxml_node_t *mxmlFindElement(mxml_node_t *node, mxml_node_t *top, extern mxml_node_t *mxmlFindElement(mxml_node_t *node, mxml_node_t *top,
const char *name, const char *attr, const char *name, const char *attr,
const char *value, int descend); const char *value, int descend);
extern mxml_node_t *mxmlFindValue(mxml_node_t *node, const char *path); extern mxml_node_t *mxmlFindPath(mxml_node_t *node, const char *path);
extern char *mxmlGetCDATA(mxml_node_t *node); extern const char *mxmlGetCDATA(mxml_node_t *node);
extern void *mxmlGetCustom(mxml_node_t *node); extern const void *mxmlGetCustom(mxml_node_t *node);
extern char *mxmlGetElement(mxml_node_t *node); extern const char *mxmlGetElement(mxml_node_t *node);
extern mxml_node_t *mxmlGetFirstChild(mxml_node_t *node); extern mxml_node_t *mxmlGetFirstChild(mxml_node_t *node);
extern int mxmlGetInteger(mxml_node_t *node); extern int mxmlGetInteger(mxml_node_t *node);
extern mxml_node_t *mxmlGetLastChild(mxml_node_t *node); extern mxml_node_t *mxmlGetLastChild(mxml_node_t *node);
extern mxml_node_t *mxmlGetNext(mxml_node_t *node); extern mxml_node_t *mxmlGetNextSibling(mxml_node_t *node);
extern char *mxmlGetOpaque(mxml_node_t *node); extern const char *mxmlGetOpaque(mxml_node_t *node);
extern mxml_node_t *mxmlGetParent(mxml_node_t *node); extern mxml_node_t *mxmlGetParent(mxml_node_t *node);
extern mxml_node_t *mxmlGetPrevious(mxml_node_t *node); extern mxml_node_t *mxmlGetPrevSibling(mxml_node_t *node);
extern double mxmlGetReal(mxml_node_t *node); extern double mxmlGetReal(mxml_node_t *node);
extern char *mxmlGetText(mxml_node_t *node, int *whitespace); extern int mxmlGetRefCount(mxml_node_t *node);
extern const char *mxmlGetText(mxml_node_t *node, int *whitespace);
extern mxml_type_t mxmlGetType(mxml_node_t *node); extern mxml_type_t mxmlGetType(mxml_node_t *node);
extern void *mxmlGetUserData(mxml_node_t *node); extern void *mxmlGetUserData(mxml_node_t *node);
extern void mxmlIndexDelete(mxml_index_t *ind); extern void mxmlIndexDelete(mxml_index_t *ind);

@ -197,17 +197,20 @@ constrains the search to a particular node's children.</description>
<description>Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST</description> <description>Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST</description>
</argument> </argument>
</function> </function>
<function name="mxmlFindValue"> <function name="mxmlFindPath">
<returnvalue> <returnvalue>
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>First value node or NULL</description> <description>Found node or NULL</description>
</returnvalue> </returnvalue>
<description>Find a value with the given path. <description>Find a node with the given path.
The &quot;path&quot; is a slash-separated list of element names. The name &quot;*&quot; is 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, 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.
The first child node of the found node is returned if the given node has
children and the first child is a value node.
@since Mini-XML 2.7@</description> @since Mini-XML 2.7@</description>
<argument name="top" direction="I"> <argument name="top" direction="I">
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
@ -220,7 +223,7 @@ considered a wildcard for one or more levels of elements. For example,
</function> </function>
<function name="mxmlGetCDATA"> <function name="mxmlGetCDATA">
<returnvalue> <returnvalue>
<type>char *</type> <type>const char *</type>
<description>CDATA value or NULL</description> <description>CDATA value or NULL</description>
</returnvalue> </returnvalue>
<description>Get the value for a CDATA node. <description>Get the value for a CDATA node.
@ -235,7 +238,7 @@ considered a wildcard for one or more levels of elements. For example,
</function> </function>
<function name="mxmlGetCustom"> <function name="mxmlGetCustom">
<returnvalue> <returnvalue>
<type>void *</type> <type>const void *</type>
<description>Custom value or NULL</description> <description>Custom value or NULL</description>
</returnvalue> </returnvalue>
<description>Get the value for a custom node. <description>Get the value for a custom node.
@ -251,7 +254,7 @@ value node.
</function> </function>
<function name="mxmlGetElement"> <function name="mxmlGetElement">
<returnvalue> <returnvalue>
<type>char *</type> <type>const char *</type>
<description>Element name or NULL</description> <description>Element name or NULL</description>
</returnvalue> </returnvalue>
<description>Get the name for an element node. <description>Get the name for an element node.
@ -312,7 +315,7 @@ has no children.
<description>Node to get</description> <description>Node to get</description>
</argument> </argument>
</function> </function>
<function name="mxmlGetNext"> <function name="mxmlGetNextSibling">
<returnvalue> <returnvalue>
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>Get the next node for the current parent. <description>Get the next node for the current parent.
@ -329,7 +332,7 @@ has no children.
</function> </function>
<function name="mxmlGetOpaque"> <function name="mxmlGetOpaque">
<returnvalue> <returnvalue>
<type>char *</type> <type>const char *</type>
<description>Opaque string or NULL</description> <description>Opaque string or NULL</description>
</returnvalue> </returnvalue>
<description>Get an opaque string value for a node or its first child. <description>Get an opaque string value for a node or its first child.
@ -358,7 +361,7 @@ value node.
<description>Node to get</description> <description>Node to get</description>
</argument> </argument>
</function> </function>
<function name="mxmlGetPrevious"> <function name="mxmlGetPrevSibling">
<returnvalue> <returnvalue>
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>Previous node or NULL</description> <description>Previous node or NULL</description>
@ -388,9 +391,26 @@ value node.
<description>Node to get</description> <description>Node to get</description>
</argument> </argument>
</function> </function>
<function name="mxmlGetRefCount">
<returnvalue>
<type>int</type>
<description>Reference count</description>
</returnvalue>
<description>Get the current reference (use) count for a node.
The initial reference count of new nodes is 1. Use the @link mxmlRetain@
and @link mxmlRelease@ functions to increment and decrement a node's
reference count.
@since Mini-XML 2.7@.</description>
<argument name="node" direction="I">
<type>mxml_node_t *</type>
<description>Node</description>
</argument>
</function>
<function name="mxmlGetText"> <function name="mxmlGetText">
<returnvalue> <returnvalue>
<type>char *</type> <type>const char *</type>
<description>Text string or NULL</description> <description>Text string or NULL</description>
</returnvalue> </returnvalue>
<description>Get the text value for a node or its first child. <description>Get the text value for a node or its first child.

@ -261,10 +261,10 @@ main(int argc, /* I - Number of command-line args */
} }
/* /*
* Test mxmlFindValue... * Test mxmlFindPath...
*/ */
node = mxmlFindValue(tree, "*/two"); node = mxmlFindPath(tree, "*/two");
if (!node) if (!node)
{ {
fputs("ERROR: Unable to find value for \"*/two\".\n", stderr); fputs("ERROR: Unable to find value for \"*/two\".\n", stderr);
@ -278,7 +278,7 @@ main(int argc, /* I - Number of command-line args */
return (1); return (1);
} }
node = mxmlFindValue(tree, "foo/*/two"); node = mxmlFindPath(tree, "foo/*/two");
if (!node) if (!node)
{ {
fputs("ERROR: Unable to find value for \"foo/*/two\".\n", stderr); fputs("ERROR: Unable to find value for \"foo/*/two\".\n", stderr);
@ -292,7 +292,7 @@ main(int argc, /* I - Number of command-line args */
return (1); return (1);
} }
node = mxmlFindValue(tree, "foo/bar/one/two"); node = mxmlFindPath(tree, "foo/bar/one/two");
if (!node) if (!node)
{ {
fputs("ERROR: Unable to find value for \"foo/bar/one/two\".\n", stderr); fputs("ERROR: Unable to find value for \"foo/bar/one/two\".\n", stderr);

@ -17,10 +17,26 @@ EXPORTS
mxmlEntityGetValue mxmlEntityGetValue
mxmlEntityRemoveCallback mxmlEntityRemoveCallback
mxmlFindElement mxmlFindElement
mxmlFindValue mxmlFindPath
mxmlGetCDATA
mxmlGetCustom
mxmlGetElement
mxmlGetFirstChild
mxmlGetInteger
mxmlGetLastChild
mxmlGetNextSibling
mxmlGetOpaque
mxmlGetParent
mxmlGetPrevSibling
mxmlGetReal
mxmlGetRefCount
mxmlGetText
mxmlGetType
mxmlGetUserData
mxmlIndexDelete mxmlIndexDelete
mxmlIndexEnum mxmlIndexEnum
mxmlIndexFind mxmlIndexFind
mxmlIndexGetCount
mxmlIndexNew mxmlIndexNew
mxmlIndexReset mxmlIndexReset
mxmlLoadFd mxmlLoadFd
@ -55,6 +71,7 @@ EXPORTS
mxmlSetReal mxmlSetReal
mxmlSetText mxmlSetText
mxmlSetTextf mxmlSetTextf
mxmlSetUserData
mxmlSetWrapMargin mxmlSetWrapMargin
mxmlWalkNext mxmlWalkNext
mxmlWalkPrev mxmlWalkPrev

@ -196,6 +196,10 @@
RelativePath="..\mxml-file.c" RelativePath="..\mxml-file.c"
> >
</File> </File>
<File
RelativePath="..\mxml-get.c"
>
</File>
<File <File
RelativePath="..\mxml-index.c" RelativePath="..\mxml-index.c"
> >

Loading…
Cancel
Save