diff options
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/Makefile.am | 241 | ||||
-rw-r--r-- | doc/examples/Makefile.in | 611 | ||||
-rw-r--r-- | doc/examples/examples.xml | 450 | ||||
-rw-r--r-- | doc/examples/index.html | 14 | ||||
-rwxr-xr-x | doc/examples/index.py | 92 | ||||
-rw-r--r-- | doc/examples/io1.c | 2 | ||||
-rw-r--r-- | doc/examples/io1.res | 2 | ||||
-rw-r--r-- | doc/examples/io2.c | 2 | ||||
-rw-r--r-- | doc/examples/reader1.c | 2 | ||||
-rw-r--r-- | doc/examples/reader2.c | 2 | ||||
-rw-r--r-- | doc/examples/reader3.c | 2 | ||||
-rw-r--r-- | doc/examples/reader4.c | 2 | ||||
-rw-r--r-- | doc/examples/testWriter.c | 10 | ||||
-rw-r--r-- | doc/examples/tree1.c | 2 | ||||
-rw-r--r-- | doc/examples/tree2.c | 2 | ||||
-rw-r--r-- | doc/examples/xpath1.c | 2 | ||||
-rw-r--r-- | doc/examples/xpath2.c | 2 |
17 files changed, 788 insertions, 652 deletions
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index bdac7bb..57af9c2 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -1,134 +1,135 @@ -# Beware this is autogenerated by index.py -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ -DEPS = $(top_builddir)/libxml2.la -LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ +## +## This file is auto-generated by index.py +## DO NOT EDIT !!! +## +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include +AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) +LDADD = $(RDL_LIBS) $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD) + +CLEANFILES = *.tmp + +if REBUILD_DOCS rebuild: examples.xml index.html +.PHONY: rebuild -examples.xml: index.py *.c - -@($(srcdir)/index.py) +examples.xml: index.py $(noinst_PROGRAMS:=.c) + cd $(srcdir) && $(PYTHON) index.py + $(MAKE) Makefile index.html: examples.xml examples.xsl - -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) + cd $(srcdir) && xsltproc examples.xsl examples.xml && echo "Rebuilt web page" + -cd $(srcdir) && xmllint --valid --noout index.html +endif install-data-local: - @MKDIR_P@ $(DESTDIR)$(HTML_DIR) - -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) - -EXTRA_DIST=examples.xsl index.py examples.xml writer.xml test3.xml tst.xml test1.xml test2.xml io2.res xpath2.res tree1.res reader4.res io1.res tree2.res reader3.res xpath1.res reader1.res - -noinst_PROGRAMS=xpath2 reader1 reader4 parse2 reader2 parse3 reader3 tree2 parse4 io2 testWriter io1 xpath1 parse1 tree1 - -xpath2_SOURCES=xpath2.c -xpath2_LDFLAGS= -xpath2_DEPENDENCIES= $(DEPS) -xpath2_LDADD= @RDL_LIBS@ $(LDADDS) - -reader1_SOURCES=reader1.c -reader1_LDFLAGS= -reader1_DEPENDENCIES= $(DEPS) -reader1_LDADD= @RDL_LIBS@ $(LDADDS) - -reader4_SOURCES=reader4.c -reader4_LDFLAGS= -reader4_DEPENDENCIES= $(DEPS) -reader4_LDADD= @RDL_LIBS@ $(LDADDS) - -parse2_SOURCES=parse2.c -parse2_LDFLAGS= -parse2_DEPENDENCIES= $(DEPS) -parse2_LDADD= @RDL_LIBS@ $(LDADDS) - -reader2_SOURCES=reader2.c -reader2_LDFLAGS= -reader2_DEPENDENCIES= $(DEPS) -reader2_LDADD= @RDL_LIBS@ $(LDADDS) - -parse3_SOURCES=parse3.c -parse3_LDFLAGS= -parse3_DEPENDENCIES= $(DEPS) -parse3_LDADD= @RDL_LIBS@ $(LDADDS) - -reader3_SOURCES=reader3.c -reader3_LDFLAGS= -reader3_DEPENDENCIES= $(DEPS) -reader3_LDADD= @RDL_LIBS@ $(LDADDS) - -tree2_SOURCES=tree2.c -tree2_LDFLAGS= -tree2_DEPENDENCIES= $(DEPS) -tree2_LDADD= @RDL_LIBS@ $(LDADDS) - -parse4_SOURCES=parse4.c -parse4_LDFLAGS= -parse4_DEPENDENCIES= $(DEPS) -parse4_LDADD= @RDL_LIBS@ $(LDADDS) - -io2_SOURCES=io2.c -io2_LDFLAGS= -io2_DEPENDENCIES= $(DEPS) -io2_LDADD= @RDL_LIBS@ $(LDADDS) - -testWriter_SOURCES=testWriter.c -testWriter_LDFLAGS= -testWriter_DEPENDENCIES= $(DEPS) -testWriter_LDADD= @RDL_LIBS@ $(LDADDS) - -io1_SOURCES=io1.c -io1_LDFLAGS= -io1_DEPENDENCIES= $(DEPS) -io1_LDADD= @RDL_LIBS@ $(LDADDS) - -xpath1_SOURCES=xpath1.c -xpath1_LDFLAGS= -xpath1_DEPENDENCIES= $(DEPS) -xpath1_LDADD= @RDL_LIBS@ $(LDADDS) - -parse1_SOURCES=parse1.c -parse1_LDFLAGS= -parse1_DEPENDENCIES= $(DEPS) -parse1_LDADD= @RDL_LIBS@ $(LDADDS) - -tree1_SOURCES=tree1.c -tree1_LDFLAGS= -tree1_DEPENDENCIES= $(DEPS) -tree1_LDADD= @RDL_LIBS@ $(LDADDS) + $(MKDIR_P) $(DESTDIR)$(HTML_DIR) + -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) + +clean-local: + test -f Makefile.am || rm -f test?.xml + +EXTRA_DIST = \ + examples.xml \ + examples.xsl \ + index.html \ + index.py \ + io1.res \ + io2.res \ + reader1.res \ + reader3.res \ + reader4.res \ + test1.xml \ + test2.xml \ + test3.xml \ + tree1.res \ + tree2.res \ + tst.xml \ + writer.xml \ + xpath1.res \ + xpath2.res + +noinst_PROGRAMS = \ + io1 \ + io2 \ + parse1 \ + parse2 \ + parse3 \ + parse4 \ + reader1 \ + reader2 \ + reader3 \ + reader4 \ + testWriter \ + tree1 \ + tree2 \ + xpath1 \ + xpath2 + +io1_SOURCES = io1.c + +io2_SOURCES = io2.c + +parse1_SOURCES = parse1.c + +parse2_SOURCES = parse2.c + +parse3_SOURCES = parse3.c + +parse4_SOURCES = parse4.c + +reader1_SOURCES = reader1.c + +reader2_SOURCES = reader2.c + +reader3_SOURCES = reader3.c + +reader4_SOURCES = reader4.c + +testWriter_SOURCES = testWriter.c + +tree1_SOURCES = tree1.c + +tree2_SOURCES = tree2.c + +xpath1_SOURCES = xpath1.c + +xpath2_SOURCES = xpath2.c valgrind: $(MAKE) CHECKER='valgrind' tests tests: $(noinst_PROGRAMS) + test -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml . @(echo '## examples regression tests') @(echo > .memdump) - @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse2 test2.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse3) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse4 test3.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse1 test1.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - - + $(CHECKER) ./io1 > io1.tmp && diff io1.tmp $(srcdir)/io1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./io2 > io2.tmp && diff io2.tmp $(srcdir)/io2.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse1 test1.xml + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse2 test2.xml + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse3 + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse4 test3.xml + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp && diff reader4.tmp $(srcdir)/reader4.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./tree1 test2.xml > tree1.tmp && diff tree1.tmp $(srcdir)/tree1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 diff --git a/doc/examples/Makefile.in b/doc/examples/Makefile.in index 9d08434..7b66627 100644 --- a/doc/examples/Makefile.in +++ b/doc/examples/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,18 +78,19 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = xpath2$(EXEEXT) reader1$(EXEEXT) reader4$(EXEEXT) \ - parse2$(EXEEXT) reader2$(EXEEXT) parse3$(EXEEXT) \ - reader3$(EXEEXT) tree2$(EXEEXT) parse4$(EXEEXT) io2$(EXEEXT) \ - testWriter$(EXEEXT) io1$(EXEEXT) xpath1$(EXEEXT) \ - parse1$(EXEEXT) tree1$(EXEEXT) +noinst_PROGRAMS = io1$(EXEEXT) io2$(EXEEXT) parse1$(EXEEXT) \ + parse2$(EXEEXT) parse3$(EXEEXT) parse4$(EXEEXT) \ + reader1$(EXEEXT) reader2$(EXEEXT) reader3$(EXEEXT) \ + reader4$(EXEEXT) testWriter$(EXEEXT) tree1$(EXEEXT) \ + tree2$(EXEEXT) xpath1$(EXEEXT) xpath2$(EXEEXT) subdir = doc/examples -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -55,84 +100,126 @@ CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_io1_OBJECTS = io1.$(OBJEXT) io1_OBJECTS = $(am_io1_OBJECTS) +io1_LDADD = $(LDADD) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +io1_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent -io1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(io1_LDFLAGS) $(LDFLAGS) -o $@ +am__v_lt_1 = am_io2_OBJECTS = io2.$(OBJEXT) io2_OBJECTS = $(am_io2_OBJECTS) -io2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(io2_LDFLAGS) $(LDFLAGS) -o $@ +io2_LDADD = $(LDADD) +io2_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_parse1_OBJECTS = parse1.$(OBJEXT) parse1_OBJECTS = $(am_parse1_OBJECTS) -parse1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(parse1_LDFLAGS) $(LDFLAGS) -o $@ +parse1_LDADD = $(LDADD) +parse1_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_parse2_OBJECTS = parse2.$(OBJEXT) parse2_OBJECTS = $(am_parse2_OBJECTS) -parse2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(parse2_LDFLAGS) $(LDFLAGS) -o $@ +parse2_LDADD = $(LDADD) +parse2_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_parse3_OBJECTS = parse3.$(OBJEXT) parse3_OBJECTS = $(am_parse3_OBJECTS) -parse3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(parse3_LDFLAGS) $(LDFLAGS) -o $@ +parse3_LDADD = $(LDADD) +parse3_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_parse4_OBJECTS = parse4.$(OBJEXT) parse4_OBJECTS = $(am_parse4_OBJECTS) -parse4_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(parse4_LDFLAGS) $(LDFLAGS) -o $@ +parse4_LDADD = $(LDADD) +parse4_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_reader1_OBJECTS = reader1.$(OBJEXT) reader1_OBJECTS = $(am_reader1_OBJECTS) -reader1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(reader1_LDFLAGS) $(LDFLAGS) -o $@ +reader1_LDADD = $(LDADD) +reader1_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_reader2_OBJECTS = reader2.$(OBJEXT) reader2_OBJECTS = $(am_reader2_OBJECTS) -reader2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(reader2_LDFLAGS) $(LDFLAGS) -o $@ +reader2_LDADD = $(LDADD) +reader2_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_reader3_OBJECTS = reader3.$(OBJEXT) reader3_OBJECTS = $(am_reader3_OBJECTS) -reader3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(reader3_LDFLAGS) $(LDFLAGS) -o $@ +reader3_LDADD = $(LDADD) +reader3_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_reader4_OBJECTS = reader4.$(OBJEXT) reader4_OBJECTS = $(am_reader4_OBJECTS) -reader4_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(reader4_LDFLAGS) $(LDFLAGS) -o $@ +reader4_LDADD = $(LDADD) +reader4_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_testWriter_OBJECTS = testWriter.$(OBJEXT) testWriter_OBJECTS = $(am_testWriter_OBJECTS) -testWriter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testWriter_LDFLAGS) $(LDFLAGS) -o $@ +testWriter_LDADD = $(LDADD) +testWriter_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_tree1_OBJECTS = tree1.$(OBJEXT) tree1_OBJECTS = $(am_tree1_OBJECTS) -tree1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(tree1_LDFLAGS) $(LDFLAGS) -o $@ +tree1_LDADD = $(LDADD) +tree1_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_tree2_OBJECTS = tree2.$(OBJEXT) tree2_OBJECTS = $(am_tree2_OBJECTS) -tree2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(tree2_LDFLAGS) $(LDFLAGS) -o $@ +tree2_LDADD = $(LDADD) +tree2_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_xpath1_OBJECTS = xpath1.$(OBJEXT) xpath1_OBJECTS = $(am_xpath1_OBJECTS) -xpath1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(xpath1_LDFLAGS) $(LDFLAGS) -o $@ +xpath1_LDADD = $(LDADD) +xpath1_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_xpath2_OBJECTS = xpath2.$(OBJEXT) xpath2_OBJECTS = $(am_xpath2_OBJECTS) -xpath2_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(xpath2_LDFLAGS) $(LDFLAGS) -o $@ +xpath2_LDADD = $(LDADD) +xpath2_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -143,22 +230,18 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(io1_SOURCES) $(io2_SOURCES) $(parse1_SOURCES) \ $(parse2_SOURCES) $(parse3_SOURCES) $(parse4_SOURCES) \ $(reader1_SOURCES) $(reader2_SOURCES) $(reader3_SOURCES) \ @@ -169,6 +252,28 @@ DIST_SOURCES = $(io1_SOURCES) $(io2_SOURCES) $(parse1_SOURCES) \ $(reader1_SOURCES) $(reader2_SOURCES) $(reader3_SOURCES) \ $(reader4_SOURCES) $(testWriter_SOURCES) $(tree1_SOURCES) \ $(tree2_SOURCES) $(xpath1_SOURCES) $(xpath2_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -176,7 +281,6 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -213,6 +317,7 @@ HTML_DIR = @HTML_DIR@ HTML_OBJ = @HTML_OBJ@ HTTP_OBJ = @HTTP_OBJ@ ICONV_LIBS = @ICONV_LIBS@ +ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -257,6 +362,9 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_LIBS = @PYTHON_LIBS@ @@ -268,7 +376,6 @@ RANLIB = @RANLIB@ RDL_LIBS = @RDL_LIBS@ READER_TEST = @READER_TEST@ RELDATE = @RELDATE@ -RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -293,7 +400,6 @@ TEST_VTIME = @TEST_VTIME@ TEST_XINCLUDE = @TEST_XINCLUDE@ TEST_XPATH = @TEST_XPATH@ TEST_XPTR = @TEST_XPTR@ -THREADS_W32 = @THREADS_W32@ THREAD_CFLAGS = @THREAD_CFLAGS@ THREAD_LIBS = @THREAD_LIBS@ VERSION = @VERSION@ @@ -326,6 +432,7 @@ WITH_SAX1 = @WITH_SAX1@ WITH_SCHEMAS = @WITH_SCHEMAS@ WITH_SCHEMATRON = @WITH_SCHEMATRON@ WITH_THREADS = @WITH_THREADS@ +WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@ WITH_TREE = @WITH_TREE@ WITH_TRIO = @WITH_TRIO@ WITH_VALID = @WITH_VALID@ @@ -399,72 +506,45 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include +AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) +LDADD = $(RDL_LIBS) $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD) +CLEANFILES = *.tmp +EXTRA_DIST = \ + examples.xml \ + examples.xsl \ + index.html \ + index.py \ + io1.res \ + io2.res \ + reader1.res \ + reader3.res \ + reader4.res \ + test1.xml \ + test2.xml \ + test3.xml \ + tree1.res \ + tree2.res \ + tst.xml \ + writer.xml \ + xpath1.res \ + xpath2.res -# Beware this is autogenerated by index.py -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ -DEPS = $(top_builddir)/libxml2.la -LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ -EXTRA_DIST = examples.xsl index.py examples.xml writer.xml test3.xml tst.xml test1.xml test2.xml io2.res xpath2.res tree1.res reader4.res io1.res tree2.res reader3.res xpath1.res reader1.res -xpath2_SOURCES = xpath2.c -xpath2_LDFLAGS = -xpath2_DEPENDENCIES = $(DEPS) -xpath2_LDADD = @RDL_LIBS@ $(LDADDS) -reader1_SOURCES = reader1.c -reader1_LDFLAGS = -reader1_DEPENDENCIES = $(DEPS) -reader1_LDADD = @RDL_LIBS@ $(LDADDS) -reader4_SOURCES = reader4.c -reader4_LDFLAGS = -reader4_DEPENDENCIES = $(DEPS) -reader4_LDADD = @RDL_LIBS@ $(LDADDS) +io1_SOURCES = io1.c +io2_SOURCES = io2.c +parse1_SOURCES = parse1.c parse2_SOURCES = parse2.c -parse2_LDFLAGS = -parse2_DEPENDENCIES = $(DEPS) -parse2_LDADD = @RDL_LIBS@ $(LDADDS) -reader2_SOURCES = reader2.c -reader2_LDFLAGS = -reader2_DEPENDENCIES = $(DEPS) -reader2_LDADD = @RDL_LIBS@ $(LDADDS) parse3_SOURCES = parse3.c -parse3_LDFLAGS = -parse3_DEPENDENCIES = $(DEPS) -parse3_LDADD = @RDL_LIBS@ $(LDADDS) -reader3_SOURCES = reader3.c -reader3_LDFLAGS = -reader3_DEPENDENCIES = $(DEPS) -reader3_LDADD = @RDL_LIBS@ $(LDADDS) -tree2_SOURCES = tree2.c -tree2_LDFLAGS = -tree2_DEPENDENCIES = $(DEPS) -tree2_LDADD = @RDL_LIBS@ $(LDADDS) parse4_SOURCES = parse4.c -parse4_LDFLAGS = -parse4_DEPENDENCIES = $(DEPS) -parse4_LDADD = @RDL_LIBS@ $(LDADDS) -io2_SOURCES = io2.c -io2_LDFLAGS = -io2_DEPENDENCIES = $(DEPS) -io2_LDADD = @RDL_LIBS@ $(LDADDS) +reader1_SOURCES = reader1.c +reader2_SOURCES = reader2.c +reader3_SOURCES = reader3.c +reader4_SOURCES = reader4.c testWriter_SOURCES = testWriter.c -testWriter_LDFLAGS = -testWriter_DEPENDENCIES = $(DEPS) -testWriter_LDADD = @RDL_LIBS@ $(LDADDS) -io1_SOURCES = io1.c -io1_LDFLAGS = -io1_DEPENDENCIES = $(DEPS) -io1_LDADD = @RDL_LIBS@ $(LDADDS) -xpath1_SOURCES = xpath1.c -xpath1_LDFLAGS = -xpath1_DEPENDENCIES = $(DEPS) -xpath1_LDADD = @RDL_LIBS@ $(LDADDS) -parse1_SOURCES = parse1.c -parse1_LDFLAGS = -parse1_DEPENDENCIES = $(DEPS) -parse1_LDADD = @RDL_LIBS@ $(LDADDS) tree1_SOURCES = tree1.c -tree1_LDFLAGS = -tree1_DEPENDENCIES = $(DEPS) -tree1_LDADD = @RDL_LIBS@ $(LDADDS) +tree2_SOURCES = tree2.c +xpath1_SOURCES = xpath1.c +xpath2_SOURCES = xpath2.c all: all-am .SUFFIXES: @@ -508,51 +588,66 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -io1$(EXEEXT): $(io1_OBJECTS) $(io1_DEPENDENCIES) + +io1$(EXEEXT): $(io1_OBJECTS) $(io1_DEPENDENCIES) $(EXTRA_io1_DEPENDENCIES) @rm -f io1$(EXEEXT) - $(AM_V_CCLD)$(io1_LINK) $(io1_OBJECTS) $(io1_LDADD) $(LIBS) -io2$(EXEEXT): $(io2_OBJECTS) $(io2_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(io1_OBJECTS) $(io1_LDADD) $(LIBS) + +io2$(EXEEXT): $(io2_OBJECTS) $(io2_DEPENDENCIES) $(EXTRA_io2_DEPENDENCIES) @rm -f io2$(EXEEXT) - $(AM_V_CCLD)$(io2_LINK) $(io2_OBJECTS) $(io2_LDADD) $(LIBS) -parse1$(EXEEXT): $(parse1_OBJECTS) $(parse1_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(io2_OBJECTS) $(io2_LDADD) $(LIBS) + +parse1$(EXEEXT): $(parse1_OBJECTS) $(parse1_DEPENDENCIES) $(EXTRA_parse1_DEPENDENCIES) @rm -f parse1$(EXEEXT) - $(AM_V_CCLD)$(parse1_LINK) $(parse1_OBJECTS) $(parse1_LDADD) $(LIBS) -parse2$(EXEEXT): $(parse2_OBJECTS) $(parse2_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(parse1_OBJECTS) $(parse1_LDADD) $(LIBS) + +parse2$(EXEEXT): $(parse2_OBJECTS) $(parse2_DEPENDENCIES) $(EXTRA_parse2_DEPENDENCIES) @rm -f parse2$(EXEEXT) - $(AM_V_CCLD)$(parse2_LINK) $(parse2_OBJECTS) $(parse2_LDADD) $(LIBS) -parse3$(EXEEXT): $(parse3_OBJECTS) $(parse3_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(parse2_OBJECTS) $(parse2_LDADD) $(LIBS) + +parse3$(EXEEXT): $(parse3_OBJECTS) $(parse3_DEPENDENCIES) $(EXTRA_parse3_DEPENDENCIES) @rm -f parse3$(EXEEXT) - $(AM_V_CCLD)$(parse3_LINK) $(parse3_OBJECTS) $(parse3_LDADD) $(LIBS) -parse4$(EXEEXT): $(parse4_OBJECTS) $(parse4_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(parse3_OBJECTS) $(parse3_LDADD) $(LIBS) + +parse4$(EXEEXT): $(parse4_OBJECTS) $(parse4_DEPENDENCIES) $(EXTRA_parse4_DEPENDENCIES) @rm -f parse4$(EXEEXT) - $(AM_V_CCLD)$(parse4_LINK) $(parse4_OBJECTS) $(parse4_LDADD) $(LIBS) -reader1$(EXEEXT): $(reader1_OBJECTS) $(reader1_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(parse4_OBJECTS) $(parse4_LDADD) $(LIBS) + +reader1$(EXEEXT): $(reader1_OBJECTS) $(reader1_DEPENDENCIES) $(EXTRA_reader1_DEPENDENCIES) @rm -f reader1$(EXEEXT) - $(AM_V_CCLD)$(reader1_LINK) $(reader1_OBJECTS) $(reader1_LDADD) $(LIBS) -reader2$(EXEEXT): $(reader2_OBJECTS) $(reader2_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(reader1_OBJECTS) $(reader1_LDADD) $(LIBS) + +reader2$(EXEEXT): $(reader2_OBJECTS) $(reader2_DEPENDENCIES) $(EXTRA_reader2_DEPENDENCIES) @rm -f reader2$(EXEEXT) - $(AM_V_CCLD)$(reader2_LINK) $(reader2_OBJECTS) $(reader2_LDADD) $(LIBS) -reader3$(EXEEXT): $(reader3_OBJECTS) $(reader3_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(reader2_OBJECTS) $(reader2_LDADD) $(LIBS) + +reader3$(EXEEXT): $(reader3_OBJECTS) $(reader3_DEPENDENCIES) $(EXTRA_reader3_DEPENDENCIES) @rm -f reader3$(EXEEXT) - $(AM_V_CCLD)$(reader3_LINK) $(reader3_OBJECTS) $(reader3_LDADD) $(LIBS) -reader4$(EXEEXT): $(reader4_OBJECTS) $(reader4_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(reader3_OBJECTS) $(reader3_LDADD) $(LIBS) + +reader4$(EXEEXT): $(reader4_OBJECTS) $(reader4_DEPENDENCIES) $(EXTRA_reader4_DEPENDENCIES) @rm -f reader4$(EXEEXT) - $(AM_V_CCLD)$(reader4_LINK) $(reader4_OBJECTS) $(reader4_LDADD) $(LIBS) -testWriter$(EXEEXT): $(testWriter_OBJECTS) $(testWriter_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(reader4_OBJECTS) $(reader4_LDADD) $(LIBS) + +testWriter$(EXEEXT): $(testWriter_OBJECTS) $(testWriter_DEPENDENCIES) $(EXTRA_testWriter_DEPENDENCIES) @rm -f testWriter$(EXEEXT) - $(AM_V_CCLD)$(testWriter_LINK) $(testWriter_OBJECTS) $(testWriter_LDADD) $(LIBS) -tree1$(EXEEXT): $(tree1_OBJECTS) $(tree1_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(testWriter_OBJECTS) $(testWriter_LDADD) $(LIBS) + +tree1$(EXEEXT): $(tree1_OBJECTS) $(tree1_DEPENDENCIES) $(EXTRA_tree1_DEPENDENCIES) @rm -f tree1$(EXEEXT) - $(AM_V_CCLD)$(tree1_LINK) $(tree1_OBJECTS) $(tree1_LDADD) $(LIBS) -tree2$(EXEEXT): $(tree2_OBJECTS) $(tree2_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(tree1_OBJECTS) $(tree1_LDADD) $(LIBS) + +tree2$(EXEEXT): $(tree2_OBJECTS) $(tree2_DEPENDENCIES) $(EXTRA_tree2_DEPENDENCIES) @rm -f tree2$(EXEEXT) - $(AM_V_CCLD)$(tree2_LINK) $(tree2_OBJECTS) $(tree2_LDADD) $(LIBS) -xpath1$(EXEEXT): $(xpath1_OBJECTS) $(xpath1_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(tree2_OBJECTS) $(tree2_LDADD) $(LIBS) + +xpath1$(EXEEXT): $(xpath1_OBJECTS) $(xpath1_DEPENDENCIES) $(EXTRA_xpath1_DEPENDENCIES) @rm -f xpath1$(EXEEXT) - $(AM_V_CCLD)$(xpath1_LINK) $(xpath1_OBJECTS) $(xpath1_LDADD) $(LIBS) -xpath2$(EXEEXT): $(xpath2_OBJECTS) $(xpath2_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(xpath1_OBJECTS) $(xpath1_LDADD) $(LIBS) + +xpath2$(EXEEXT): $(xpath2_OBJECTS) $(xpath2_DEPENDENCIES) $(EXTRA_xpath2_DEPENDENCIES) @rm -f xpath2$(EXEEXT) - $(AM_V_CCLD)$(xpath2_LINK) $(xpath2_OBJECTS) $(xpath2_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(xpath2_OBJECTS) $(xpath2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -579,26 +674,23 @@ distclean-compile: .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -606,26 +698,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -637,15 +718,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -654,6 +731,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -702,13 +794,19 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -719,7 +817,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ +clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -790,69 +888,76 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ - install-data-local install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-local clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am + tags tags-am uninstall uninstall-am -rebuild: examples.xml index.html +@REBUILD_DOCS_TRUE@rebuild: examples.xml index.html +@REBUILD_DOCS_TRUE@.PHONY: rebuild -examples.xml: index.py *.c - -@($(srcdir)/index.py) +@REBUILD_DOCS_TRUE@examples.xml: index.py $(noinst_PROGRAMS:=.c) +@REBUILD_DOCS_TRUE@ cd $(srcdir) && $(PYTHON) index.py +@REBUILD_DOCS_TRUE@ $(MAKE) Makefile -index.html: examples.xml examples.xsl - -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) +@REBUILD_DOCS_TRUE@index.html: examples.xml examples.xsl +@REBUILD_DOCS_TRUE@ cd $(srcdir) && xsltproc examples.xsl examples.xml && echo "Rebuilt web page" +@REBUILD_DOCS_TRUE@ -cd $(srcdir) && xmllint --valid --noout index.html install-data-local: - @MKDIR_P@ $(DESTDIR)$(HTML_DIR) - -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) + $(MKDIR_P) $(DESTDIR)$(HTML_DIR) + -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) + +clean-local: + test -f Makefile.am || rm -f test?.xml valgrind: $(MAKE) CHECKER='valgrind' tests tests: $(noinst_PROGRAMS) + test -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml . @(echo '## examples regression tests') @(echo > .memdump) - @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse2 test2.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse3) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse4 test3.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./parse1 test1.xml) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) - @($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp) - @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0) + $(CHECKER) ./io1 > io1.tmp && diff io1.tmp $(srcdir)/io1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./io2 > io2.tmp && diff io2.tmp $(srcdir)/io2.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse1 test1.xml + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse2 test2.xml + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse3 + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./parse4 test3.xml + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp && diff reader4.tmp $(srcdir)/reader4.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./tree1 test2.xml > tree1.tmp && diff tree1.tmp $(srcdir)/tree1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 + $(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res + @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml index a237a0e..28929cc 100644 --- a/doc/examples/examples.xml +++ b/doc/examples/examples.xml @@ -1,74 +1,9 @@ <examples> - <example filename='reader2.c'> - <synopsis>Parse and validate an XML file with an xmlReader</synopsis> - <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose> - <usage>reader2 <valid_xml_filename></usage> - <test>reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test> - <author>Daniel Veillard</author> - <copy>see Copyright for the status of this software. </copy> - <section>xmlReader</section> - <includes> - <include><libxml/xmlreader.h></include> - </includes> - <uses> - <function line='45' file='xmlstring' name='xmlStrlen'/> - <function line='109' file='parser' name='xmlCleanupParser'/> - <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/> - <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/> - <function line='113' file='xmlmemory' name='xmlMemoryDump'/> - <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/> - <enum line='70' file='parser' name='XML_PARSE_NOENT'/> - <function line='37' file='xmlreader' name='xmlTextReaderDepth'/> - <enum line='71' file='parser' name='XML_PARSE_DTDVALID'/> - <enum line='69' file='parser' name='XML_PARSE_DTDATTR'/> - <function line='84' file='xmlreader' name='xmlFreeTextReader'/> - <macro line='104' file='xmlversion' name='LIBXML_TEST_VERSION'/> - <function line='30' file='xmlreader' name='xmlTextReaderConstName'/> - <function line='41' file='xmlreader' name='xmlTextReaderHasValue'/> - <function line='76' file='xmlreader' name='xmlTextReaderRead'/> - <function line='40' file='xmlreader' name='xmlTextReaderIsEmptyElement'/> - <function line='68' file='xmlreader' name='xmlReaderForFile'/> - <function line='81' file='xmlreader' name='xmlTextReaderIsValid'/> - </uses> - </example> - <example filename='xpath2.c'> - <synopsis>Load a document, locate subelements with XPath, modify said elements and save the resulting document.</synopsis> - <purpose>Shows how to make a full round-trip from a load/edit/save</purpose> - <usage>xpath2 <xml-file> <xpath-expr> <new-value></usage> - <test>xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp</test> - <author>Aleksey Sanin and Daniel Veillard</author> - <copy>see Copyright for the status of this software. </copy> - <section>XPath</section> - <includes> - <include><libxml/parser.h></include> - <include><libxml/xpath.h></include> - <include><libxml/xpathInternals.h></include> - <include><libxml/tree.h></include> - </includes> - <uses> - <function line='162' file='tree' name='xmlNodeSetContent'/> - <function line='127' file='tree' name='xmlDocDump'/> - <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/> - <function line='56' file='xmlmemory' name='xmlMemoryDump'/> - <function line='110' file='xpath' name='xmlXPathEvalExpression'/> - <function line='95' file='parser' name='xmlParseFile'/> - <function line='123' file='xpath' name='xmlXPathFreeObject'/> - <function line='102' file='xpath' name='xmlXPathNewContext'/> - <function line='51' file='parser' name='xmlCleanupParser'/> - <macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/> - <typedef line='87' file='xpath' name='xmlXPathContextPtr'/> - <function line='124' file='xpath' name='xmlXPathFreeContext'/> - <function line='41' file='parser' name='xmlInitParser'/> - <function line='131' file='tree' name='xmlFreeDoc'/> - <enum line='180' file='tree' name='XML_NAMESPACE_DECL'/> - <typedef line='86' file='tree' name='xmlDocPtr'/> - </uses> - </example> <example filename='xpath1.c'> <synopsis>Evaluate XPath expression and prints result node set.</synopsis> <purpose>Shows how to evaluate XPath expression and register known namespaces in XPath context.</purpose> <usage>xpath1 <xml-file> <xpath-expr> [<known-ns-list>]</usage> - <test>./xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp</test> + <test>xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res</test> <author>Aleksey Sanin</author> <copy>see Copyright for the status of this software. </copy> <section>XPath</section> @@ -123,34 +58,43 @@ <typedef line='27' file='tree' name='xmlDocPtr'/> </uses> </example> - <example filename='io2.c'> - <synopsis>Output to char buffer</synopsis> - <purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose> - <usage>io2</usage> - <test>io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp</test> - <author>John Fleck</author> + <example filename='reader2.c'> + <synopsis>Parse and validate an XML file with an xmlReader</synopsis> + <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose> + <usage>reader2 <valid_xml_filename></usage> + <test>reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res</test> + <author>Daniel Veillard</author> <copy>see Copyright for the status of this software. </copy> - <section>InputOutput</section> + <section>xmlReader</section> <includes> - <include><libxml/parser.h></include> + <include><libxml/xmlreader.h></include> </includes> <uses> - <function line='29' file='tree' name='xmlNodeSetContent'/> - <function line='36' file='tree' name='xmlDocDumpFormatMemory'/> - <variable line='42' file='globals' name='xmlFree'/> - <function line='30' file='tree' name='xmlDocSetRootElement'/> - <typedef line='20' file='tree' name='xmlDocPtr'/> - <function line='43' file='tree' name='xmlFreeDoc'/> - <typedef line='19' file='tree' name='xmlNodePtr'/> - <function line='27' file='tree' name='xmlNewDoc'/> - <function line='28' file='tree' name='xmlNewNode'/> + <function line='45' file='xmlstring' name='xmlStrlen'/> + <function line='109' file='parser' name='xmlCleanupParser'/> + <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/> + <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/> + <function line='113' file='xmlmemory' name='xmlMemoryDump'/> + <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/> + <enum line='70' file='parser' name='XML_PARSE_NOENT'/> + <function line='37' file='xmlreader' name='xmlTextReaderDepth'/> + <enum line='71' file='parser' name='XML_PARSE_DTDVALID'/> + <enum line='69' file='parser' name='XML_PARSE_DTDATTR'/> + <function line='84' file='xmlreader' name='xmlFreeTextReader'/> + <macro line='104' file='xmlversion' name='LIBXML_TEST_VERSION'/> + <function line='30' file='xmlreader' name='xmlTextReaderConstName'/> + <function line='41' file='xmlreader' name='xmlTextReaderHasValue'/> + <function line='76' file='xmlreader' name='xmlTextReaderRead'/> + <function line='40' file='xmlreader' name='xmlTextReaderIsEmptyElement'/> + <function line='68' file='xmlreader' name='xmlReaderForFile'/> + <function line='81' file='xmlreader' name='xmlTextReaderIsValid'/> </uses> </example> <example filename='tree2.c'> <synopsis>Creates a tree</synopsis> <purpose>Shows how to create document, nodes and dump it to stdout or file.</purpose> <usage>tree2 <filename> -Default output: stdout</usage> - <test>tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp</test> + <test>tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res</test> <author>Lucas Brasilino <brasilino@recife.pe.gov.br></author> <copy>see Copyright for the status of this software </copy> <section>Tree</section> @@ -174,11 +118,113 @@ <function line='39' file='tree' name='xmlNewDoc'/> </uses> </example> + <example filename='io1.c'> + <synopsis>Example of custom Input/Output</synopsis> + <purpose>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</purpose> + <usage>io1</usage> + <test>io1 > io1.tmp && diff io1.tmp $(srcdir)/io1.res</test> + <author>Daniel Veillard</author> + <copy>see Copyright for the status of this software. </copy> + <section>InputOutput</section> + <includes> + <include><libxml/parser.h></include> + <include><libxml/xmlIO.h></include> + <include><libxml/xinclude.h></include> + <include><libxml/tree.h></include> + </includes> + <uses> + <function line='143' file='tree' name='xmlDocDump'/> + <function line='158' file='xmlmemory' name='xmlMemoryDump'/> + <function line='149' file='tree' name='xmlFreeDoc'/> + <function line='154' file='parser' name='xmlCleanupParser'/> + <macro line='117' file='xmlversion' name='LIBXML_TEST_VERSION'/> + <function line='134' file='xinclude' name='xmlXIncludeProcess'/> + <function line='117' file='xmlIO' name='xmlRegisterInputCallbacks'/> + <function line='124' file='parser' name='xmlReadMemory'/> + <typedef line='105' file='tree' name='xmlDocPtr'/> + </uses> + </example> + <example filename='parse4.c'> + <synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis> + <purpose>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree</purpose> + <usage>parse4 test3.xml</usage> + <test>parse4 test3.xml</test> + <author>Daniel Veillard</author> + <copy>see Copyright for the status of this software. </copy> + <section>Parsing</section> + <includes> + <include><libxml/tree.h></include> + <include><libxml/parser.h></include> + </includes> + <uses> + <function line='94' file='parser' name='xmlFreeParserCtxt'/> + <function line='86' file='parser' name='xmlParseChunk'/> + <function line='103' file='tree' name='xmlFreeDoc'/> + <function line='135' file='xmlmemory' name='xmlMemoryDump'/> + <function line='67' file='parser' name='xmlCreatePushParserCtxt'/> + <function line='131' file='parser' name='xmlCleanupParser'/> + <macro line='120' file='xmlversion' name='LIBXML_TEST_VERSION'/> + <typedef line='45' file='tree' name='xmlParserCtxtPtr'/> + <typedef line='47' file='tree' name='xmlDocPtr'/> + </uses> + </example> + <example filename='xpath2.c'> + <synopsis>Load a document, locate subelements with XPath, modify said elements and save the resulting document.</synopsis> + <purpose>Shows how to make a full round-trip from a load/edit/save</purpose> + <usage>xpath2 <xml-file> <xpath-expr> <new-value></usage> + <test>xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res</test> + <author>Aleksey Sanin and Daniel Veillard</author> + <copy>see Copyright for the status of this software. </copy> + <section>XPath</section> + <includes> + <include><libxml/parser.h></include> + <include><libxml/xpath.h></include> + <include><libxml/xpathInternals.h></include> + <include><libxml/tree.h></include> + </includes> + <uses> + <function line='162' file='tree' name='xmlNodeSetContent'/> + <function line='127' file='tree' name='xmlDocDump'/> + <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/> + <function line='110' file='xpath' name='xmlXPathEvalExpression'/> + <function line='95' file='parser' name='xmlParseFile'/> + <function line='123' file='xpath' name='xmlXPathFreeObject'/> + <function line='102' file='xpath' name='xmlXPathNewContext'/> + <typedef line='87' file='xpath' name='xmlXPathContextPtr'/> + <function line='124' file='xpath' name='xmlXPathFreeContext'/> + <function line='41' file='parser' name='xmlInitParser'/> + <function line='131' file='tree' name='xmlFreeDoc'/> + <enum line='180' file='tree' name='XML_NAMESPACE_DECL'/> + <typedef line='86' file='tree' name='xmlDocPtr'/> + </uses> + </example> + <example filename='io2.c'> + <synopsis>Output to char buffer</synopsis> + <purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose> + <usage>io2</usage> + <test>io2 > io2.tmp && diff io2.tmp $(srcdir)/io2.res</test> + <author>John Fleck</author> + <copy>see Copyright for the status of this software. </copy> + <section>InputOutput</section> + <includes> + <include><libxml/parser.h></include> + </includes> + <uses> + <function line='29' file='tree' name='xmlNodeSetContent'/> + <function line='36' file='tree' name='xmlDocDumpFormatMemory'/> + <variable line='42' file='globals' name='xmlFree'/> + <function line='30' file='tree' name='xmlDocSetRootElement'/> + <typedef line='20' file='tree' name='xmlDocPtr'/> + <typedef line='19' file='tree' name='xmlNodePtr'/> + <function line='27' file='tree' name='xmlNewDoc'/> + <function line='28' file='tree' name='xmlNewNode'/> + </uses> + </example> <example filename='reader1.c'> <synopsis>Parse an XML file with an xmlReader</synopsis> <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose> <usage>reader1 <filename></usage> - <test>reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test> + <test>reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res</test> <author>Daniel Veillard</author> <copy>see Copyright for the status of this software. </copy> <section>xmlReader</section> @@ -187,14 +233,11 @@ </includes> <uses> <function line='44' file='xmlstring' name='xmlStrlen'/> - <function line='94' file='parser' name='xmlCleanupParser'/> <function line='37' file='xmlreader' name='xmlTextReaderNodeType'/> <typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/> - <function line='98' file='xmlmemory' name='xmlMemoryDump'/> <function line='33' file='xmlreader' name='xmlTextReaderConstValue'/> <function line='36' file='xmlreader' name='xmlTextReaderDepth'/> <function line='69' file='xmlreader' name='xmlFreeTextReader'/> - <macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/> <function line='29' file='xmlreader' name='xmlTextReaderConstName'/> <function line='40' file='xmlreader' name='xmlTextReaderHasValue'/> <function line='67' file='xmlreader' name='xmlTextReaderRead'/> @@ -202,77 +245,29 @@ <function line='62' file='xmlreader' name='xmlReaderForFile'/> </uses> </example> - <example filename='testWriter.c'> - <synopsis>use various APIs for the xmlWriter</synopsis> - <purpose>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</purpose> - <usage>testWriter</usage> - <test>testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res</test> - <author>Alfred Mickautsch</author> - <copy>see Copyright for the status of this software. </copy> - <section>xmlWriter</section> - <includes> - <include><libxml/encoding.h></include> - <include><libxml/xmlwriter.h></include> - </includes> - <uses> - <function line='913' file='xmlwriter' name='xmlTextWriterStartDocument'/> - <function line='1121' file='xmlwriter' name='xmlTextWriterEndDocument'/> - <variable line='1183' file='globals' name='xmlRealloc'/> - <function line='925' file='xmlwriter' name='xmlTextWriterWriteComment'/> - <function line='1156' file='encoding' name='xmlFindCharEncodingHandler'/> - <variable line='1166' file='globals' name='xmlMalloc'/> - <typedef line='879' file='tree' name='xmlDocPtr'/> - <typedef line='341' file='tree' name='xmlBufferPtr'/> - <macro line='885' file='parser' name='XML_DEFAULT_VERSION'/> - <function line='901' file='tree' name='xmlDocSetRootElement'/> - <function line='1127' file='xmlwriter' name='xmlFreeTextWriter'/> - <function line='1096' file='xmlwriter' name='xmlTextWriterStartElement'/> - <function line='347' file='tree' name='xmlBufferCreate'/> - <function line='1111' file='xmlwriter' name='xmlTextWriterEndElement'/> - <function line='76' file='xmlwriter' name='xmlNewTextWriterFilename'/> - <function line='959' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/> - <function line='1073' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/> - <typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/> - <function line='1131' file='tree' name='xmlFreeDoc'/> - <typedef line='880' file='tree' name='xmlNodePtr'/> - <function line='949' file='xmlwriter' name='xmlTextWriterWriteAttribute'/> - <function line='632' file='xmlwriter' name='xmlNewTextWriterDoc'/> - <function line='894' file='tree' name='xmlNewDocNode'/> - <function line='1129' file='tree' name='xmlSaveFileEnc'/> - <function line='904' file='xmlwriter' name='xmlNewTextWriterTree'/> - <function line='355' file='xmlwriter' name='xmlNewTextWriterMemory'/> - <variable line='1180' file='globals' name='xmlFree'/> - <function line='613' file='tree' name='xmlBufferFree'/> - <typedef line='878' file='xmlwriter' name='xmlTextWriterPtr'/> - <function line='1103' file='xmlwriter' name='xmlTextWriterWriteElement'/> - <function line='885' file='tree' name='xmlNewDoc'/> - </uses> - </example> - <example filename='parse4.c'> - <synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis> - <purpose>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree</purpose> - <usage>parse4 test3.xml</usage> - <test>parse4 test3.xml</test> - <author>Daniel Veillard</author> + <example filename='tree1.c'> + <synopsis>Navigates a tree to print element names</synopsis> + <purpose>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</purpose> + <usage>tree1 filename_or_URL</usage> + <test>tree1 test2.xml > tree1.tmp && diff tree1.tmp $(srcdir)/tree1.res</test> + <author>Dodji Seketeli</author> <copy>see Copyright for the status of this software. </copy> - <section>Parsing</section> + <section>Tree</section> <includes> <include><libxml/tree.h></include> <include><libxml/parser.h></include> </includes> <uses> - <function line='94' file='parser' name='xmlFreeParserCtxt'/> - <function line='86' file='parser' name='xmlParseChunk'/> - <function line='67' file='parser' name='xmlCreatePushParserCtxt'/> - <typedef line='45' file='tree' name='xmlParserCtxtPtr'/> - <typedef line='47' file='tree' name='xmlDocPtr'/> + <enum line='36' file='tree' name='XML_ELEMENT_NODE'/> + <function line='74' file='tree' name='xmlDocGetRootElement'/> + <function line='67' file='parser' name='xmlReadFile'/> </uses> </example> <example filename='reader3.c'> <synopsis>Show how to extract subdocuments with xmlReader</synopsis> <purpose>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose> <usage>reader3</usage> - <test>reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp</test> + <test>reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res</test> <author>Daniel Veillard</author> <copy>see Copyright for the status of this software. </copy> <section>xmlReader</section> @@ -289,25 +284,24 @@ <function line='38' file='xmlreader' name='xmlReaderForFile'/> </uses> </example> - <example filename='io1.c'> - <synopsis>Example of custom Input/Output</synopsis> - <purpose>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</purpose> - <usage>io1</usage> - <test>io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp</test> + <example filename='parse2.c'> + <synopsis>Parse and validate an XML file to a tree and free the result</synopsis> + <purpose>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</purpose> + <usage>parse2 test2.xml</usage> + <test>parse2 test2.xml</test> <author>Daniel Veillard</author> <copy>see Copyright for the status of this software. </copy> - <section>InputOutput</section> + <section>Parsing</section> <includes> - <include><libxml/parser.h></include> - <include><libxml/xmlIO.h></include> - <include><libxml/xinclude.h></include> <include><libxml/tree.h></include> + <include><libxml/parser.h></include> </includes> <uses> - <function line='143' file='tree' name='xmlDocDump'/> - <function line='134' file='xinclude' name='xmlXIncludeProcess'/> - <function line='117' file='xmlIO' name='xmlRegisterInputCallbacks'/> - <function line='124' file='parser' name='xmlReadMemory'/> + <function line='47' file='parser' name='xmlFreeParserCtxt'/> + <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/> + <function line='29' file='parser' name='xmlNewParserCtxt'/> + <typedef line='25' file='tree' name='xmlParserCtxtPtr'/> + <function line='35' file='parser' name='xmlCtxtReadFile'/> </uses> </example> <example filename='parse1.c'> @@ -326,29 +320,11 @@ <function line='26' file='parser' name='xmlReadFile'/> </uses> </example> - <example filename='tree1.c'> - <synopsis>Navigates a tree to print element names</synopsis> - <purpose>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</purpose> - <usage>tree1 filename_or_URL</usage> - <test>tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp</test> - <author>Dodji Seketeli</author> - <copy>see Copyright for the status of this software. </copy> - <section>Tree</section> - <includes> - <include><libxml/tree.h></include> - <include><libxml/parser.h></include> - </includes> - <uses> - <enum line='36' file='tree' name='XML_ELEMENT_NODE'/> - <function line='74' file='tree' name='xmlDocGetRootElement'/> - <function line='67' file='parser' name='xmlReadFile'/> - </uses> - </example> <example filename='reader4.c'> <synopsis>Parse multiple XML files reusing an xmlReader</synopsis> <purpose>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose> <usage>reader4 <filename> [ filename ... ]</usage> - <test>reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp</test> + <test>reader4 test1.xml test2.xml test3.xml > reader4.tmp && diff reader4.tmp $(srcdir)/reader4.res</test> <author>Graham Bennett</author> <copy>see Copyright for the status of this software. </copy> <section>xmlReader</section> @@ -364,34 +340,58 @@ <function line='72' file='xmlreader' name='xmlReaderForFile'/> </uses> </example> - <example filename='parse2.c'> - <synopsis>Parse and validate an XML file to a tree and free the result</synopsis> - <purpose>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</purpose> - <usage>parse2 test2.xml</usage> - <test>parse2 test2.xml</test> - <author>Daniel Veillard</author> + <example filename='testWriter.c'> + <synopsis>use various APIs for the xmlWriter</synopsis> + <purpose>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</purpose> + <usage>testWriter</usage> + <test>testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done</test> + <author>Alfred Mickautsch</author> <copy>see Copyright for the status of this software. </copy> - <section>Parsing</section> + <section>xmlWriter</section> <includes> - <include><libxml/tree.h></include> - <include><libxml/parser.h></include> + <include><libxml/encoding.h></include> + <include><libxml/xmlwriter.h></include> </includes> <uses> - <function line='47' file='parser' name='xmlFreeParserCtxt'/> - <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/> - <function line='29' file='parser' name='xmlNewParserCtxt'/> - <typedef line='25' file='tree' name='xmlParserCtxtPtr'/> - <function line='35' file='parser' name='xmlCtxtReadFile'/> + <function line='913' file='xmlwriter' name='xmlTextWriterStartDocument'/> + <function line='1121' file='xmlwriter' name='xmlTextWriterEndDocument'/> + <variable line='1183' file='globals' name='xmlRealloc'/> + <function line='925' file='xmlwriter' name='xmlTextWriterWriteComment'/> + <function line='1156' file='encoding' name='xmlFindCharEncodingHandler'/> + <variable line='1166' file='globals' name='xmlMalloc'/> + <typedef line='341' file='tree' name='xmlBufferPtr'/> + <macro line='885' file='parser' name='XML_DEFAULT_VERSION'/> + <function line='901' file='tree' name='xmlDocSetRootElement'/> + <function line='1127' file='xmlwriter' name='xmlFreeTextWriter'/> + <function line='1096' file='xmlwriter' name='xmlTextWriterStartElement'/> + <function line='347' file='tree' name='xmlBufferCreate'/> + <function line='1111' file='xmlwriter' name='xmlTextWriterEndElement'/> + <function line='76' file='xmlwriter' name='xmlNewTextWriterFilename'/> + <function line='959' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/> + <function line='1073' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/> + <typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/> + <typedef line='880' file='tree' name='xmlNodePtr'/> + <function line='949' file='xmlwriter' name='xmlTextWriterWriteAttribute'/> + <function line='632' file='xmlwriter' name='xmlNewTextWriterDoc'/> + <function line='894' file='tree' name='xmlNewDocNode'/> + <function line='1129' file='tree' name='xmlSaveFileEnc'/> + <function line='904' file='xmlwriter' name='xmlNewTextWriterTree'/> + <function line='355' file='xmlwriter' name='xmlNewTextWriterMemory'/> + <variable line='1180' file='globals' name='xmlFree'/> + <function line='613' file='tree' name='xmlBufferFree'/> + <typedef line='878' file='xmlwriter' name='xmlTextWriterPtr'/> + <function line='1103' file='xmlwriter' name='xmlTextWriterWriteElement'/> + <function line='885' file='tree' name='xmlNewDoc'/> </uses> </example> <symbols> <symbol name='LIBXML_TEST_VERSION'> - <ref filename='reader2.c'/> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> <ref filename='parse3.c'/> + <ref filename='reader2.c'/> <ref filename='tree2.c'/> - <ref filename='reader1.c'/> + <ref filename='io1.c'/> + <ref filename='parse4.c'/> </symbol> <symbol name='XML_DEFAULT_VERSION'> <ref filename='testWriter.c'/> @@ -401,8 +401,8 @@ <ref filename='tree1.c'/> </symbol> <symbol name='XML_NAMESPACE_DECL'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='XML_PARSE_DTDATTR'> <ref filename='reader2.c'/> @@ -430,12 +430,12 @@ <ref filename='testWriter.c'/> </symbol> <symbol name='xmlCleanupParser'> - <ref filename='reader2.c'/> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> <ref filename='parse3.c'/> + <ref filename='reader2.c'/> <ref filename='tree2.c'/> - <ref filename='reader1.c'/> + <ref filename='io1.c'/> + <ref filename='parse4.c'/> </symbol> <symbol name='xmlCreateIntSubset'> <ref filename='tree2.c'/> @@ -447,9 +447,9 @@ <ref filename='parse2.c'/> </symbol> <symbol name='xmlDocDump'> + <ref filename='io1.c'/> <ref filename='xpath2.c'/> <ref filename='reader3.c'/> - <ref filename='io1.c'/> </symbol> <symbol name='xmlDocDumpFormatMemory'> <ref filename='io2.c'/> @@ -458,16 +458,16 @@ <ref filename='tree1.c'/> </symbol> <symbol name='xmlDocPtr'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> <ref filename='parse3.c'/> - <ref filename='io2.c'/> - <ref filename='testWriter.c'/> + <ref filename='io1.c'/> <ref filename='parse4.c'/> + <ref filename='xpath2.c'/> + <ref filename='io2.c'/> </symbol> <symbol name='xmlDocSetRootElement'> - <ref filename='io2.c'/> <ref filename='tree2.c'/> + <ref filename='io2.c'/> <ref filename='testWriter.c'/> </symbol> <symbol name='xmlFindCharEncodingHandler'> @@ -479,12 +479,12 @@ <ref filename='testWriter.c'/> </symbol> <symbol name='xmlFreeDoc'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> <ref filename='parse3.c'/> - <ref filename='io2.c'/> <ref filename='tree2.c'/> - <ref filename='testWriter.c'/> + <ref filename='io1.c'/> + <ref filename='parse4.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlFreeParserCtxt'> <ref filename='parse4.c'/> @@ -500,34 +500,34 @@ <ref filename='testWriter.c'/> </symbol> <symbol name='xmlInitParser'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlMalloc'> <ref filename='testWriter.c'/> </symbol> <symbol name='xmlMemoryDump'> - <ref filename='reader2.c'/> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> <ref filename='parse3.c'/> + <ref filename='reader2.c'/> <ref filename='tree2.c'/> - <ref filename='reader1.c'/> + <ref filename='io1.c'/> + <ref filename='parse4.c'/> </symbol> <symbol name='xmlNewChild'> <ref filename='tree2.c'/> </symbol> <symbol name='xmlNewDoc'> - <ref filename='io2.c'/> <ref filename='tree2.c'/> + <ref filename='io2.c'/> <ref filename='testWriter.c'/> </symbol> <symbol name='xmlNewDocNode'> <ref filename='testWriter.c'/> </symbol> <symbol name='xmlNewNode'> - <ref filename='io2.c'/> <ref filename='tree2.c'/> + <ref filename='io2.c'/> </symbol> <symbol name='xmlNewParserCtxt'> <ref filename='parse2.c'/> @@ -566,16 +566,16 @@ <ref filename='parse4.c'/> </symbol> <symbol name='xmlParseFile'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlParserCtxtPtr'> <ref filename='parse4.c'/> <ref filename='parse2.c'/> </symbol> <symbol name='xmlReadFile'> - <ref filename='parse1.c'/> <ref filename='tree1.c'/> + <ref filename='parse1.c'/> </symbol> <symbol name='xmlReadMemory'> <ref filename='parse3.c'/> @@ -692,28 +692,28 @@ <ref filename='io1.c'/> </symbol> <symbol name='xmlXPathContextPtr'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlXPathEvalExpression'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlXPathFreeContext'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlXPathFreeObject'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlXPathNewContext'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlXPathObjectPtr'> - <ref filename='xpath2.c'/> <ref filename='xpath1.c'/> + <ref filename='xpath2.c'/> </symbol> <symbol name='xmlXPathRegisterNs'> <ref filename='xpath1.c'/> @@ -721,22 +721,22 @@ </symbols> <sections> <section name='InputOutput'> - <example filename='io2.c'/> <example filename='io1.c'/> + <example filename='io2.c'/> </section> <section name='Parsing'> <example filename='parse3.c'/> <example filename='parse4.c'/> - <example filename='parse1.c'/> <example filename='parse2.c'/> + <example filename='parse1.c'/> </section> <section name='Tree'> <example filename='tree2.c'/> <example filename='tree1.c'/> </section> <section name='XPath'> - <example filename='xpath2.c'/> <example filename='xpath1.c'/> + <example filename='xpath2.c'/> </section> <section name='xmlReader'> <example filename='reader2.c'/> diff --git a/doc/examples/index.html b/doc/examples/index.html new file mode 100644 index 0000000..c9314a3 --- /dev/null +++ b/doc/examples/index.html @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css"> +TD {font-family: Verdana,Arial,Helvetica} +BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em} +H1 {font-family: Verdana,Arial,Helvetica} +H2 {font-family: Verdana,Arial,Helvetica} +H3 {font-family: Verdana,Arial,Helvetica} +A:link, A:visited, A:active { text-decoration: underline } +</style><title>Libxml2 set of examples</title></head><body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Libxml2 set of examples</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Examples Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../html/index.html">API Menu</a></li><li><a href="#InputOutput">InputOutput Examples</a></li><li><a href="#Parsing">Parsing Examples</a></li><li><a href="#Tree">Tree Examples</a></li><li><a href="#XPath">XPath Examples</a></li><li><a href="#xmlReader">xmlReader Examples</a></li><li><a href="#xmlWriter">xmlWriter Examples</a></li><li><a href="../guidelines.html">XML Guidelines</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p> The examples are stored per section depending on the main focus + of the example:</p><ul><li><p><a href="#xmlWriter">xmlWriter</a> :</p><ul><li><a href="#testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</li></ul></li><li><p><a href="#InputOutput">InputOutput</a> :</p><ul><li><a href="#io1.c">io1.c</a>: Example of custom Input/Output</li><li><a href="#io2.c">io2.c</a>: Output to char buffer</li></ul></li><li><p><a href="#Tree">Tree</a> :</p><ul><li><a href="#tree2.c">tree2.c</a>: Creates a tree</li><li><a href="#tree1.c">tree1.c</a>: Navigates a tree to print element names</li></ul></li><li><p><a href="#XPath">XPath</a> :</p><ul><li><a href="#xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</li><li><a href="#xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</li></ul></li><li><p><a href="#Parsing">Parsing</a> :</p><ul><li><a href="#parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</li><li><a href="#parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</li><li><a href="#parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</li><li><a href="#parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</li></ul></li><li><p><a href="#xmlReader">xmlReader</a> :</p><ul><li><a href="#reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</li><li><a href="#reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</li><li><a href="#reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</li><li><a href="#reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</li></ul></li></ul><p> Getting the compilation options and libraries dependancies needed +to generate binaries from the examples is best done on Linux/Unix by using +the xml2-config script which should have been installed as part of <i>make +install</i> step or when installing the libxml2 development package:</p><pre>gcc -o example `xml2-config --cflags` example.c `xml2-config --libs`</pre><h2><a name="InputOutput" id="InputOutput"></a>InputOutput Examples</h2><h3><a name="io1.c" href="io1.c" id="io1.c">io1.c</a>: Example of custom Input/Output</h3><p>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xmlIO.html"><libxml/xmlIO.h></a></li><li><a href="../html/libxml-xinclude.html"><libxml/xinclude.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 105: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 117: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 117: Function <a href="../html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> from xmlIO.h</li><li> line 124: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 134: Function <a href="../html/libxml-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a> from xinclude.h</li><li> line 143: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 149: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 154: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 158: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>io1</p><p>Author: Daniel Veillard</p><h3><a name="io2.c" href="io2.c" id="io2.c">io2.c</a>: Output to char buffer</h3><p>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 19: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 20: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 27: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 28: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li><li> line 30: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 36: Function <a href="../html/libxml-tree.html#xmlDocDumpFormatMemory">xmlDocDumpFormatMemory</a> from tree.h</li></ul><p>Usage:</p><p>io2</p><p>Author: John Fleck</p><h2><a name="Parsing" id="Parsing"></a>Parsing Examples</h2><h3><a name="parse3.c" href="parse3.c" id="parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</h3><p>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 27: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 33: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 38: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 49: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 54: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 58: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse3</p><p>Author: Daniel Veillard</p><h3><a name="parse4.c" href="parse4.c" id="parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</h3><p>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 45: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 47: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 67: Function <a href="../html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a> from parser.h</li><li> line 86: Function <a href="../html/libxml-parser.html#xmlParseChunk">xmlParseChunk</a> from parser.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 103: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 120: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 131: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 135: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse4 test3.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse2.c" href="parse2.c" id="parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</h3><p>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 25: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a> from parser.h</li><li> line 35: Function <a href="../html/libxml-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> from parser.h</li><li> line 47: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li></ul><p>Usage:</p><p>parse2 test2.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse1.c" href="parse1.c" id="parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</h3><p>Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 26: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li></ul><p>Usage:</p><p>parse1 test1.xml</p><p>Author: Daniel Veillard</p><h2><a name="Tree" id="Tree"></a>Tree Examples</h2><h3><a name="tree2.c" href="tree2.c" id="tree2.c">tree2.c</a>: Creates a tree</h3><p>Shows how to create document, nodes and dump it to stdout or file.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 34: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 39: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 41: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 46: Function <a href="../html/libxml-tree.html#xmlCreateIntSubset">xmlCreateIntSubset</a> from tree.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 75: Function <a href="../html/libxml-tree.html#xmlNewText">xmlNewText</a> from tree.h</li><li> line 78: Function <a href="../html/libxml-tree.html#xmlAddChild">xmlAddChild</a> from tree.h</li><li> line 88: Function <a href="../html/libxml-tree.html#xmlNewChild">xmlNewChild</a> from tree.h</li><li> line 89: Function <a href="../html/libxml-tree.html#xmlNewProp">xmlNewProp</a> from tree.h</li><li> line 96: Function <a href="../html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a> from tree.h</li><li> line 99: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 105: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 110: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>tree2 <filename> -Default output: stdout</p><p>Author: Lucas Brasilino <brasilino@recife.pe.gov.br></p><h3><a name="tree1.c" href="tree1.c" id="tree1.c">tree1.c</a>: Navigates a tree to print element names</h3><p>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li></ul><p>Uses:</p><ul><li> line 67: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a> from tree.h</li></ul><p>Usage:</p><p>tree1 filename_or_URL</p><p>Author: Dodji Seketeli</p><h2><a name="XPath" id="XPath"></a>XPath Examples</h2><h3><a name="xpath1.c" href="xpath1.c" id="xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</h3><p>Shows how to evaluate XPath expression and register known namespaces in XPath context.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xpath.html"><libxml/xpath.h></a></li><li><a href="../html/libxml-xpathInternals.html"><libxml/xpathInternals.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 39: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 43: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 49: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 54: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li><li> line 86: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 101: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 117: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 129: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 130: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 131: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 156: Function <a href="../html/libxml-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li><li> line 180: Function <a href="../html/libxml-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li><li> line 186: Function <a href="../html/libxml-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li><li> line 206: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 218: Type <a href="../html/libxml-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li></ul><p>Usage:</p><p>xpath1 <xml-file> <xpath-expr> [<known-ns-list>]</p><p>Author: Aleksey Sanin</p><h3><a name="xpath2.c" href="xpath2.c" id="xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</h3><p>Shows how to make a full round-trip from a load/edit/save</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html"><libxml/parser.h></a></li><li><a href="../html/libxml-xpath.html"><libxml/xpath.h></a></li><li><a href="../html/libxml-xpathInternals.html"><libxml/xpathInternals.h></a></li><li><a href="../html/libxml-tree.html"><libxml/tree.h></a></li></ul><p>Uses:</p><ul><li> line 41: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 86: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 95: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 102: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 110: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 123: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 124: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 127: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 131: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 162: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li></ul><p>Usage:</p><p>xpath2 <xml-file> <xpath-expr> <new-value></p><p>Author: Aleksey Sanin and Daniel Veillard</p><h2><a name="xmlReader" id="xmlReader"></a>xmlReader Examples</h2><h3><a name="reader2.c" href="reader2.c" id="reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 30: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 34: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 41: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 45: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 60: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 68: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 76: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 81: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsValid">xmlTextReaderIsValid</a> from xmlreader.h</li><li> line 84: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 104: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 109: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 113: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>reader2 <valid_xml_filename></p><p>Author: Daniel Veillard</p><h3><a name="reader1.c" href="reader1.c" id="reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 29: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 33: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 36: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 39: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 44: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 59: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 67: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 69: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader1 <filename></p><p>Author: Daniel Veillard</p><h3><a name="reader3.c" href="reader3.c" id="reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</h3><p>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 32: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 43: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a> from xmlreader.h</li><li> line 52: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 66: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 96: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li></ul><p>Usage:</p><p>reader3</p><p>Author: Daniel Veillard</p><h3><a name="reader4.c" href="reader4.c" id="reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html"><libxml/xmlreader.h></a></li></ul><p>Uses:</p><ul><li> line 26: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 54: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 72: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 83: Function <a href="../html/libxml-xmlreader.html#xmlReaderNewFile">xmlReaderNewFile</a> from xmlreader.h</li><li> line 97: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 104: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader4 <filename> [ filename ... ]</p><p>Author: Graham Bennett</p><h2><a name="xmlWriter" id="xmlWriter"></a>xmlWriter Examples</h2><h3><a name="testWriter.c" href="testWriter.c" id="testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</h3><p>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</p><p>Includes:</p><ul><li><a href="../html/libxml-encoding.html"><libxml/encoding.h></a></li><li><a href="../html/libxml-xmlwriter.html"><libxml/xmlwriter.h></a></li></ul><p>Uses:</p><ul><li> line 76: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li><li> line 341: Type <a href="../html/libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li><li> line 347: Function <a href="../html/libxml-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li><li> line 355: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li><li> line 613: Function <a href="../html/libxml-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li><li> line 632: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li><li> line 878: Type <a href="../html/libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li><li> line 880: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 885: Macro <a href="../html/libxml-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li><li> line 885: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 894: Function <a href="../html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li><li> line 901: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 904: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li><li> line 913: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li><li> line 925: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li><li> line 949: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li><li> line 959: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li><li> line 1073: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li><li> line 1096: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li><li> line 1103: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li><li> line 1111: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li><li> line 1121: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li><li> line 1127: Function <a href="../html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li><li> line 1129: Function <a href="../html/libxml-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li><li> line 1151: Type <a href="../html/libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li><li> line 1156: Function <a href="../html/libxml-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li></ul><p>Usage:</p><p>testWriter</p><p>Author: Alfred Mickautsch</p><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html> diff --git a/doc/examples/index.py b/doc/examples/index.py index 11df6f0..7e0efaa 100755 --- a/doc/examples/index.py +++ b/doc/examples/index.py @@ -13,7 +13,7 @@ sys.path.insert(0, "..") from apibuild import CParser, escape examples = [] -extras = ['examples.xsl', 'index.py'] +extras = ['examples.xsl', 'index.html', 'index.py'] tests = [] sections = {} symbols = {} @@ -177,10 +177,10 @@ def parse(filename, output): type = id.get_type() output.write(" <%s line='%d' name='%s'/>\n" % (type, line, name)) - + output.write(" </uses>\n") output.write(" </example>\n") - + return idx def dump_symbols(output): @@ -220,43 +220,59 @@ def dump_Makefile(): extras.append(file) for file in glob.glob('*.res'): extras.append(file) - Makefile="""# Beware this is autogenerated by index.py -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@ -DEPS = $(top_builddir)/libxml2.la -LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@ + Makefile="""## +## This file is auto-generated by index.py +## DO NOT EDIT !!! +## + +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)/include +AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) +LDADD = $(RDL_LIBS) $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(ICONV_LIBS) -lm $(WIN32_EXTRA_LIBADD) +CLEANFILES = *.tmp + +if REBUILD_DOCS rebuild: examples.xml index.html +.PHONY: rebuild -examples.xml: index.py *.c - -@($(srcdir)/index.py) +examples.xml: index.py $(noinst_PROGRAMS:=.c) + cd $(srcdir) && $(PYTHON) index.py + $(MAKE) Makefile index.html: examples.xml examples.xsl - -@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html) + cd $(srcdir) && xsltproc examples.xsl examples.xml && echo "Rebuilt web page" + -cd $(srcdir) && xmllint --valid --noout index.html +endif install-data-local: - $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) - -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) + $(MKDIR_P) $(DESTDIR)$(HTML_DIR) + -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) + +clean-local: + test -f Makefile.am || rm -f test?.xml """ + examples.sort() + extras.sort() + tests.sort() EXTRA_DIST="" for extra in extras: - EXTRA_DIST = EXTRA_DIST + extra + " " - Makefile = Makefile + "EXTRA_DIST=%s\n\n" % (EXTRA_DIST) + EXTRA_DIST = EXTRA_DIST + " \\\n\t" + extra + Makefile = Makefile + "EXTRA_DIST =%s\n\n" % (EXTRA_DIST) noinst_PROGRAMS="" for example in examples: - noinst_PROGRAMS = noinst_PROGRAMS + example + " " - Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS) + noinst_PROGRAMS = noinst_PROGRAMS + " \\\n\t" + example + Makefile = Makefile + "noinst_PROGRAMS =%s\n\n" % (noinst_PROGRAMS) for example in examples: - Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= @RDL_LIBS@ $(LDADDS)\n\n" % (example, example, example, - example, example) + Makefile = Makefile + "%s_SOURCES = %s.c\n\n" % (example, example) Makefile = Makefile + "valgrind: \n\t$(MAKE) CHECKER='valgrind' tests\n\n" Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n" + Makefile = Makefile + "\ttest -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml .\n" Makefile = Makefile + "\t@(echo '## examples regression tests')\n" Makefile = Makefile + "\t@(echo > .memdump)\n" for test in tests: - Makefile = Makefile + "\t@($(CHECKER) %s)\n" % (test) - Makefile = Makefile + '\t@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)\n' - Makefile = Makefile + "\n\n" + Makefile = Makefile + "\t$(CHECKER) %s\n" % (test) + Makefile = Makefile + '\t@grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0\n' try: old = open("Makefile.am", "r").read() if old != Makefile: @@ -264,23 +280,23 @@ install-data-local: print "Updated Makefile.am" except: print "Failed to read or save Makefile.am" - # - # Autogenerate the .cvsignore too ... - # - ignore = """.memdump -Makefile.in -Makefile -""" - for example in examples: - ignore = ignore + "%s\n" % (example) - try: - old = open(".cvsignore", "r").read() - if old != ignore: - n = open(".cvsignore", "w").write(ignore) - print "Updated .cvsignore" - except: - print "Failed to read or save .cvsignore" - +# # +# # Autogenerate the .cvsignore too ... DEPRECATED +# # +# ignore = """.memdump +#Makefile.in +#Makefile +#""" +# for example in examples: +# ignore = ignore + "%s\n" % (example) +# try: +# old = open(".cvsignore", "r").read() +# if old != ignore: +# n = open(".cvsignore", "w").write(ignore) +# print "Updated .cvsignore" +# except: +# print "Failed to read or save .cvsignore" + if __name__ == "__main__": load_api() output = open("examples.xml", "w") diff --git a/doc/examples/io1.c b/doc/examples/io1.c index c8a47e3..d077cd8 100644 --- a/doc/examples/io1.c +++ b/doc/examples/io1.c @@ -6,7 +6,7 @@ * XInclude method context to show how dynamic document can * be built in a clean way. * usage: io1 - * test: io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp + * test: io1 > io1.tmp && diff io1.tmp $(srcdir)/io1.res * author: Daniel Veillard * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/io1.res b/doc/examples/io1.res index 4a4c036..adf65c7 100644 --- a/doc/examples/io1.res +++ b/doc/examples/io1.res @@ -1,5 +1,5 @@ <?xml version="1.0"?> <document xmlns:xi="http://www.w3.org/2003/XInclude"> <p>List of people:</p> - <list><people>a</people><people>b</people></list> + <list xml:base="sql://select_name_from_people"><people>a</people><people>b</people></list> </document> diff --git a/doc/examples/io2.c b/doc/examples/io2.c index 814a27e..4676f4a 100644 --- a/doc/examples/io2.c +++ b/doc/examples/io2.c @@ -4,7 +4,7 @@ * purpose: Demonstrate the use of xmlDocDumpMemory * to output document to a character buffer * usage: io2 - * test: io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp + * test: io2 > io2.tmp && diff io2.tmp $(srcdir)/io2.res * author: John Fleck * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/reader1.c b/doc/examples/reader1.c index 90db2a1..e8a005a 100644 --- a/doc/examples/reader1.c +++ b/doc/examples/reader1.c @@ -6,7 +6,7 @@ * (Note that the XMLReader functions require libxml2 version later * than 2.6.) * usage: reader1 <filename> - * test: reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp + * test: reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res * author: Daniel Veillard * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/reader2.c b/doc/examples/reader2.c index c32ada5..043b137 100644 --- a/doc/examples/reader2.c +++ b/doc/examples/reader2.c @@ -7,7 +7,7 @@ * (Note that the XMLReader functions require libxml2 version later * than 2.6.) * usage: reader2 <valid_xml_filename> - * test: reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp + * test: reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res * author: Daniel Veillard * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/reader3.c b/doc/examples/reader3.c index 51f9d3b..3eeb61f 100644 --- a/doc/examples/reader3.c +++ b/doc/examples/reader3.c @@ -7,7 +7,7 @@ * (Note that the XMLReader functions require libxml2 version later * than 2.6.) * usage: reader3 - * test: reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp + * test: reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res * author: Daniel Veillard * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/reader4.c b/doc/examples/reader4.c index ed2726a..1289d0d 100644 --- a/doc/examples/reader4.c +++ b/doc/examples/reader4.c @@ -6,7 +6,7 @@ * and parser context. (Note that the XMLReader functions require * libxml2 version later than 2.6.) * usage: reader4 <filename> [ filename ... ] - * test: reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp + * test: reader4 test1.xml test2.xml test3.xml > reader4.tmp && diff reader4.tmp $(srcdir)/reader4.res * author: Graham Bennett * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/testWriter.c b/doc/examples/testWriter.c index 9bf590f..f662f76 100644 --- a/doc/examples/testWriter.c +++ b/doc/examples/testWriter.c @@ -7,7 +7,7 @@ * do encoding string conversions too. The resulting * documents are then serialized. * usage: testWriter - * test: testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res + * test: testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done * author: Alfred Mickautsch * copy: see Copyright for the status of this software. */ @@ -37,16 +37,16 @@ main(void) LIBXML_TEST_VERSION /* first, the file version */ - testXmlwriterFilename("writer1.res"); + testXmlwriterFilename("writer1.tmp"); /* next, the memory version */ - testXmlwriterMemory("writer2.res"); + testXmlwriterMemory("writer2.tmp"); /* next, the DOM version */ - testXmlwriterDoc("writer3.res"); + testXmlwriterDoc("writer3.tmp"); /* next, the tree version */ - testXmlwriterTree("writer4.res"); + testXmlwriterTree("writer4.tmp"); /* * Cleanup function for the XML library. diff --git a/doc/examples/tree1.c b/doc/examples/tree1.c index 8644cf1..e6faefc 100644 --- a/doc/examples/tree1.c +++ b/doc/examples/tree1.c @@ -5,7 +5,7 @@ * get the root element, then walk the document and print * all the element name in document order. * usage: tree1 filename_or_URL - * test: tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp + * test: tree1 test2.xml > tree1.tmp && diff tree1.tmp $(srcdir)/tree1.res * author: Dodji Seketeli * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/tree2.c b/doc/examples/tree2.c index c40fc55..1cd1abe 100644 --- a/doc/examples/tree2.c +++ b/doc/examples/tree2.c @@ -3,7 +3,7 @@ * synopsis: Creates a tree * purpose: Shows how to create document, nodes and dump it to stdout or file. * usage: tree2 <filename> -Default output: stdout - * test: tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp + * test: tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res * author: Lucas Brasilino <brasilino@recife.pe.gov.br> * copy: see Copyright for the status of this software */ diff --git a/doc/examples/xpath1.c b/doc/examples/xpath1.c index f2f7406..0a31650 100644 --- a/doc/examples/xpath1.c +++ b/doc/examples/xpath1.c @@ -4,7 +4,7 @@ * purpose: Shows how to evaluate XPath expression and register * known namespaces in XPath context. * usage: xpath1 <xml-file> <xpath-expr> [<known-ns-list>] - * test: ./xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp + * test: xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res * author: Aleksey Sanin * copy: see Copyright for the status of this software. */ diff --git a/doc/examples/xpath2.c b/doc/examples/xpath2.c index 6ff4008..f604114 100644 --- a/doc/examples/xpath2.c +++ b/doc/examples/xpath2.c @@ -4,7 +4,7 @@ * said elements and save the resulting document. * purpose: Shows how to make a full round-trip from a load/edit/save * usage: xpath2 <xml-file> <xpath-expr> <new-value> - * test: xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp + * test: xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res * author: Aleksey Sanin and Daniel Veillard * copy: see Copyright for the status of this software. */ |