Commit 01791d57 authored by Daniel Veillard's avatar Daniel Veillard

Added the XML code developped at W3C, Daniel.

parents
Seth Alves (seth@hungry.com)
Radek Doulik <doulik@karlin.mff.cuni.cz>
Miguel de Icaza <miguel@kernel.org>
Szekeres Istvan (Pista) <szekeres@cyberspace.mht.bme.hu>
Tim Janik <timj@gimp.org>
Michael K. Johnson <johnsonm@redhat.com>
Elliot Lee <sopwith@cuc.edu>
Federico Mena <quartic@gimp.org>
Molaro Paolo <lupus@dei.unipd.it>
Jens Christian Restemeier <jchrr@hrz.Uni-Bielefeld.DE>
Tom Tromey <tromey@cygnus.com>
Marius Vollmer <mvo@zagadka.ping.de>
Eckehard Berns <eb@berns.prima.ruhr.de>
George Lebl <jirka@5z.com>
Owen Taylor <owt1@cornell.edu>
Tuomas Kuosmanen <tigert@gimp.org>
Jaka Mocnik <jaka.mocnik@kiss.uni-lj.si>
This diff is collapsed.
This diff is collapsed.
Copyright © 1998 World Wide Web Consortium, (Massachusetts Institute of
Technology, Institut National de Recherche en Informatique et en
Automatique, Keio University). All Rights Reserved.
This software is available under the GNU Library Public License as described
in the COPYING.LIB file.
Note that the original distribution from W3C is also available under the
W3C IPR SOFTWARE NOTICE, described at http://www.w3.org/COPYRIGHT.html
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Daniel Veillard <Daniel.Veillard@w3.org>
Fri Jul 24 1998
## Process this file with automake to produce Makefile.in
noinst_PROGRAMS=tester
lib_LTLIBRARIES = libxml_0.10.la
libxml_0_10_la_SOURCES = \
xml_entities.c \
xml_parser.c \
xml_tree.c
include_HEADERS = \
xml_entities.h \
xml_parser.h \
xml_tree.h
DEPS = $(top_builddir)/libxml_0.10.la
LDADDS = $(top_builddir)/libxml_0.10.la @Z_LIBS@
tester_SOURCES=tester.c
tester_LDFLAGS =
tester_DEPENDENCIES = $(DEPS)
tester_LDADD= $(LDADDS)
tests : tester
@(DIR=`pwd`; cd $(srcdir) ; for i in test/* ; do \
if [ ! -d $$i ] ; then \
if [ ! -f result/`basename $$i` ] ; then \
echo New test file `basename $$i` ; \
$$DIR/tester $$i > result/`basename $$i` ; \
else \
echo Testing `basename $$i` ; \
$$DIR/tester $$i > result.`basename $$i` ; \
diff result/`basename $$i` result.`basename $$i` ; \
rm result.`basename $$i` ; \
fi ; fi ; done)
TODO for the XML parser:
- Support for UTF-8 encoding
- progressive parsing. Currently the parser uses a single
string containing the full document. The good point is
that there is no context associated with the parser, the
full state is in the stack. The bad point is that such a
recursive design is hard to make progressive ...
- Better error handling, use a dedicated, overridable error
handling function.
- Keep track of line numbers for better error reporting.
- DOM support, instead of using a proprietary in memory
format for the document representation, the parser should
call a DOM API to actually build the resulting document.
Then the parser becomes independent of the in-memory
representation of the document. Even better using RPC's
the parser can actually build the document in another
program.
- finish the support for Entities.
- Support for Comments (bad, should be in ASAP, they are parsed
but not stored).
- Support for PI.
- Support for CDATA.
Done:
- C++ support : John Ehresman <jehresma@dsg.harvard.edu>
- Updated code to follow more recent specs, added compatibility flag
$Id$
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile GLIB."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile GLIB."
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.0h.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile GLIB."
echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
test -f xml_entities.h || {
echo "You must run this script in the top-level GLIB directory"
exit 1
}
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
aclocal
automake
autoconf
./configure "$@"
echo
echo "Now type 'make' to compile GLIB."
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.2)
AC_INIT(xml_entities.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(libxml, 0.10)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PATH_PROG(RM, rm, /bin/rm)
AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(TAR, tar, /bin/tar)
AC_PATH_PROG(GZIP, gzip, /bin/gzip)
AM_PROG_LIBTOOL
AM_MAINTAINER_MODE
dnl Checks for libraries.
Z_LIBS=
AC_CHECK_LIB(z, inflate,
AC_CHECK_HEADER(zlib.h,
Z_LIBS="-lz"; AC_DEFINE(HAVE_LIBZ)))
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h zlib.h)
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(strdup strndup strerror snprintf )
AC_SUBST(Z_LIBS)
AC_OUTPUT(Makefile)
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison touch file \`y.tab.c'
makeinfo touch the output file
yacc touch file \`y.tab.c'"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
touch config.h.in
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print \
| sed 's/^\(.*\).am$/touch \1.in/' \
| sh
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
touch y.tab.c
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id$
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here
------- test/dav1 -----------
<?xml version="1.0"?>
<?xml:namespace ns="http://www.foo.bar/boxschema" prefix="R"?>
<?xml:namespace ns="http://www.ietf.org/standards/dav/" prefix="D"?>
<D:multistatus>
<D:response>
<D:prop>
<R:bigbox>
<R:BoxType>Box type A</R:BoxType>
</R:bigbox>
<R:author>
<R:Name>J.J. Dingleheimerschmidt</R:Name>
</R:author>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:response>
<D:response>
<D:prop>
<R:DingALing/>
<R:Random/>
</D:prop>
<D:status>HTTP/1.1 403 Forbidden</D:status>
<D:responsedescription> The user does not have access to the DingALing property.
</D:responsedescription>
</D:response>
<D:responsedescription> There has been an access violation error.
</D:responsedescription>
</D:multistatus>
------- test/dav10 -----------
<?xml version="1.0"?>
<?xml:namespace ns="http://www.ietf.org/standards/dav/" prefix="D"?>
<D:owner>
<D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href>
</D:owner>
------- test/dav11 -----------
<?xml version="1.0"?>
<?xml:namespace ns="http://www.ietf.org/standards/dav/" prefix="D"?>
<D:prop>
<D:lockdiscovery>
<D:activelock>
<D:locktype>write</D:locktype>
<D:lockscope>exclusive</D:lockscope>
<D:addlocks/>
<D:owner>
<D:href>
http://www.ics.uci.edu/~ejw/contact.html
</D:href>
</D:owner>
<D:timeout>Second-604800</D:timeout>
<D:locktoken>
<D:href>
opaquelocktoken:xyz122393481230912asdfa09s8df09s7df
</D:href>
</D:locktoken>
</D:activelock>
</D:lockdiscovery>
</D:prop>
------- test/dav12 -----------
<?xml version="1.0"?>
<?xml:namespace ns="http://www.ietf.org/standards/dav/" prefix="D"?>
<D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href>
------- test/dav13 -----------
<?xml version="1.0"?>
<?xml:namespace ns="http://www.ietf.org/standards/dav/" prefix="D"?>
<D:multistatus>
<D:response>
<D:href>
http://webdav.sb.aol.com/workspace/webdav/proposal.doc
</D:href>
<D:href>
http://webdav.sb.aol.com/workspace/webdav/
</D:href>
<D:status>HTTP/1.1 202 Accepted</D:status>
</D:response>
<D:response>
<D:href>http://foo.bar/blah</D:href>
<D:status>HTTP/1.1 403 Forbidden</D:status>
</D:response>
</D:multistatus>
------- test/dav14 -----------
<?xml version="1.0"?>
<?xml:namespace ns="http://www.ietf.org/standards/dav/patch/" prefix="D"?>
<D:resourceupdate>
<D:replace XML-SPACE="PRESERVE">
<D:octet-range>14</D:octet-range>
003CTITLE003ENew
Title003C/TITLE003E </D:replace>
<D:delete>
<D:octet-range>38-50</D:octet-range>
</D:delete>
<D:insert XML-SPACE="PRESERVE">
<D:octet-range>86</D:octet-range>
003CP003ENew paragraph003C/P003E </D:insert>
</D:resourceupdate>