summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS10
-rw-r--r--ChangeLog17
-rw-r--r--Makefile.am29
-rw-r--r--NEWS7
-rw-r--r--NOTES253
-rw-r--r--README12
-rwxr-xr-xautogen.sh71
-rw-r--r--config.h.in7
-rw-r--r--configure.in105
-rw-r--r--libxslt/Makefile.am25
-rw-r--r--libxslt/xslt.c54
-rw-r--r--libxslt/xslt.h28
-rw-r--r--libxslt/xsltInternals.h36
-rw-r--r--libxslt/xsltproc.c37
-rw-r--r--tests/Makefile.am19
-rw-r--r--tests/REC1/doc.dtd7
-rw-r--r--tests/REC1/doc.xml17
-rw-r--r--tests/REC1/doc.xsl62
-rw-r--r--tests/REC1/result.xml18
-rw-r--r--tests/REC2/data.xml21
-rw-r--r--tests/REC2/html.xml22
-rw-r--r--tests/REC2/html.xsl43
-rw-r--r--tests/REC2/svg.xml18
-rw-r--r--tests/REC2/svg.xsl45
-rw-r--r--tests/REC2/vrml.xml37
-rw-r--r--tests/REC2/vrml.xsl34
-rw-r--r--xslt-config.in127
-rw-r--r--xsltConf.sh.in7
28 files changed, 1168 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 00000000..4b041e94
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,10 @@
+
+Daniel Veillard:
+ Daniel.Veillard@imag.fr
+ DV on #gnome IRC channel
+ http://veillard.com/
+ Used to work at W3C, now Red Hat
+ co-chair of W3C XML Linking WG
+ invited expert on the W3C XML Core WG
+ Author of libxml upon which this library is based.
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 00000000..6381ddc7
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,17 @@
+Sun Jan 7 13:51:30 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * libxslt/xslt.[ch] libxslt/xsltInternals.h libxslt/xsltproc.c:
+ first steps toward building the framework
+
+Sun Jan 7 12:22:13 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * NOTES: added notes taken while reading the spec.
+
+Fri Jan 5 11:34:12 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * test/REC1 test/REC2: added examples from the XSLT REC
+
+Fri Jan 5 11:14:29 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * README: basic informations
+ * Changelog: created
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000..a34c42dd
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,29 @@
+SUBDIRS = \
+ libxslt \
+ tests
+
+confexecdir=$(libdir)
+confexec_DATA = xsltConf.sh
+
+bin_SCRIPTS = xslt-config
+
+EXTRA_DIST = xsltConf.sh.in xslt-config.in
+
+
+## We create xsltConf.sh here and not from configure because we want
+## to get the paths expanded correctly. Macros like srcdir are given
+## the value NONE in configure if the user doesn't specify them (this
+## is an autoconf feature, not a bug).
+
+xsltConf.sh: xsltConf.sh.in Makefile
+## Use sed and then mv to avoid problems if the user interrupts.
+ sed -e 's?\@XSLT_LIBDIR\@?$(XSLT_LIBDIR)?g' \
+ -e 's?\@XSLT_INCLUDEDIR\@?$(XSLT_INCLUDEDIR)?g' \
+ -e 's?\@VERSION\@?$(VERSION)?g' \
+ -e 's?\@XSLT_LIBS\@?$(XSLT_LIBS)?g' \
+ < $(srcdir)/xsltConf.sh.in > xsltConf.tmp \
+ && mv xsltConf.tmp xsltConf.sh
+
+
+
+
diff --git a/NEWS b/NEWS
new file mode 100644
index 00000000..68fa275d
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,7 @@
+Sun Jan 7 14:54:28 CET 2001
+ Creating libxslt project in Gnome CVS base
+
+Fri Jan 5
+ Started reading the XSLT 1.0 spec:
+ http://www.w3.org/TR/xslt
+ W3C Recommendation 16 November 1999
diff --git a/NOTES b/NOTES
new file mode 100644
index 00000000..1314b8d1
--- /dev/null
+++ b/NOTES
@@ -0,0 +1,253 @@
+
+ NOTES relative to the implementation
+ ====================================
+
+xsl:stylesheet:
+
+ all children except xsl:import can be in any order, so this
+can be stored as one big structure.
+
+xsl:include:
+
+ this is really similar to XInclude, can be implemented as a
+nearly separate processing just after the XML stylesheet has been
+parsed.
+ Detect loops using a limited stack ...
+
+xsl:import:
+
+ seems this should be really implemented as having a stylesheet
+sublist being itself an import list
+
+ add the list at the end
+ when doing a resolution explore child before siblings in the list
+
+3 Data Model, we should operate on parsed trees
+
+3.1 No problem
+
+3.2 use the XML Base call, XSLT-1.1 references it
+
+3.4 Whitespace Stripping
+
+ Seems one may have to do a bit of preprocessing on both the
+stylesheet trees and the source trees.
+
+4 Expressions
+
+ looks okay, wondering about variable bindings though...
+ default namespace not in scope
+
+5.1 Processing Model
+
+ look in Michael Kay's book about how to efficiently find the
+template applying to a node. Might influence the in-memory stylesheet
+representation
+
+5.2 Patterns
+
+ the end of that section suggest that the expression could be computed in
+a simpler way. Maybe templates needs to be evaluated differently than
+through the normal XPath processing. This can be implemented separately
+or build an expression tree in the XPath module and use a different
+evaluation mechanism. Not sure this is best.
+
+5.4 Applying Template Rules
+
+ xsl:apply-templates is the recurstion mechanism, note the select
+mechanism.
+
+ detection of loop: once the applied nodeset has been computed,
+check that none of the elements is part of the existing set in use, this
+may be costly and should be triggered only at a certain depth.
+
+5.5 Conflict Resolution for Template Rules
+
+ Sounds again that evaluation of a pattern rule should provide one
+more information not provided by the standard XPath evaluation
+
+5.6 Overriding Template Rules
+
+ another recursion mechanism, confirm that it is needed to separate
+the imported stylesheets.
+
+5.7 Modes
+
+ Confusing ??? need an example.
+
+6 Named Templates
+
+ No big deal it seems
+
+7.1.1 Literal Result Elements
+
+ cleanup of the namespace template should be done initially at stylesheet
+parsing.
+
+7.1.2 Creating Elements with xsl:element
+
+ okay, I bet it's usually used with { } expression computations
+
+7.1.3 Creating Attributes with xsl:attribute
+
+ need some running code to better understand all the subtilties
+
+7.1.4 Named Attribute Sets
+
+ Okay just a way to mimick param entities use fo attrib groups in Dtd's
+
+7.2 Creating Text
+
+ adjacent text nodes are merged ... okay
+ output escapeing might need a libxml API extension
+
+7.3 Creating Processing Instructions
+7.4 Creating Comments
+
+ RAS, one just need to make a couple of trivial checks
+
+7.5 Copying
+
+ Okay will need some testing
+
+7.6.1 Generating Text with xsl:value-of
+
+ will be a good test for XPath string() function
+ note in the example that the text nodes are coalesced
+
+7.6.2 Attribute Value Templates
+
+ hum, this is
+ - contextual
+ - uses XPath
+
+ best seems to parse, generate an evaluation tree then evaluate
+when accessed. Note that multipe expressions can be associated to
+a single attribute. Sounds like i will have to introduce a new
+element type inserted in the attribute nodelist. dohh ...
+
+7.7 Numbering
+
+ sounds interesting for users but might be costly, we will see ...
+
+7.7.1 Number to String Conversion Attributes
+
+ format="..." :-( it's gonna be painful ...
+
+8 Repetition
+9 Conditional Processing
+
+ doesn't sounds hard to implement since we are at an interpreter
+level but really useful in practice. Will be simple once the overall
+framework is set-up.
+
+10 Sorting
+
+ Okay applied to the node list of an xsl:apply-templates or xsl:for-each
+
+ The NOTEs are a bit scary ...
+
+11 Variables and Parameters
+
+ Variables can only be afttected at the top level, so it
+seems they act only as global variables ...
+ But this is by regions .... so some of the statements within
+a stylesheet my use a different set than others ... in practice
+it turns to be nearly like loacal variables ....
+ Need more thinking on this to handle it properly.
+ Might explain on of TOM's requests w.r.t. variable resolution
+
+11.1 Result Tree Fragments
+
+ Dohhh a new type ...
+ actually it's just a node set restricted type
+
+11.2 Values of Variables and Parameters
+
+ okay, real problem is scoping ...
+
+11.3 Using Values of Variables and Parameters with xsl:copy-of
+
+ No surprize
+
+11.4 Top-level Variables and Parameters
+
+ It is an error if a stylesheet contains more than one binding
+ of a top-level variable with the same name and same import precedence
+
+ => ah ah, so it seems one can associate the variable bindings
+to a stylesheet and if needed recurse down the import list if not
+found, would simplify things a lot !
+
+ If the template or expression specifying the value of a global variable
+x references a global variable y, then the value for y must be computed
+before the value of x.
+
+ => Values can probably be computed dynamically at reference
+time, if this generate a loop, then it's an error. Lazy computations
+are great ...
+
+11.5 Variables and Parameters within Templates
+
+
+ xsl:variable is allowed anywhere within a template that an instruction
+is allowed. In this case, the binding is visible for all following siblings
+and their descendants.
+ It is an error if a binding established by an xsl:variable or xsl:param
+element within a template shadows another binding established by an
+xsl:variable or xsl:param element also within the template.
+
+ => the example seems to imply that we can simply keep a list of
+ local variable binding to a template ... sounds fine.
+
+11.6 Passing Parameters to Templates
+
+ => Okay the parameter overrides the local binding
+
+12.1 Multiple Source Documents
+12.2 Keys
+
+ skipped for now
+
+12.3 Number Formatting
+
+ reimplementing Java formatting in C is gonna be a pain !
+
+12.4 Miscellaneous Additional Functions
+
+ current() => trivial
+
+ unparsed-entity-uri() => support in uri.c should do
+
+ generate-id() => use the in-memory address of the node ???
+
+ system-property() => sounds simple
+
+13 Messages
+
+ trivial I/Os
+
+14 Extensions
+15 Fallback
+
+ skipped for now
+
+16 Output
+
+16.1 XML Output Method
+
+ sounds that calling directly libxml output on the result tree
+should do it with a few caveats, for example one need to be
+able to parametrize the output
+
+16.2 HTML Output Method
+
+ sounds that calling libxml HTML output should do it too
+
+16.3 Text Output Method
+
+ doesn't sounds too hard ...
+
+16.4 Disabling Output Escaping
+
+ hum ... might be a bit painful to implement with the current framework.
diff --git a/README b/README
new file mode 100644
index 00000000..37f544ad
--- /dev/null
+++ b/README
@@ -0,0 +1,12 @@
+
+ XSLT support for libxml
+
+ http://xmlsoft.org/
+
+ Requires libxml2 with XPath support.
+Currently unusable, very early steps ...
+
+Daniel Veillard
+
+Daniel.Veillard@imag.fr
+$Id$
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 00000000..c39f5cc7
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+THEDIR=`pwd`
+cd $srcdir
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile gnome-xml."
+ 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 gnome-xml."
+ 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 gnome-xml."
+ 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 libxslt/xslt.h || {
+ echo "You must run this script in the top-level gdome 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
+
+echo "Running libtoolize..."
+libtoolize --copy --force
+echo "Running aclocal..."
+aclocal $ACLOCAL_FLAGS
+echo "Running automake..."
+automake --add-missing
+echo "Running autoconf..."
+autoconf
+
+cd $THEDIR
+
+if test x$OBJ_DIR != x; then
+ mkdir -p "$OBJ_DIR"
+ cd "$OBJ_DIR"
+fi
+
+conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+
+echo Running configure $conf_flags "$@" ...
+$srcdir/configure $conf_flags "$@"
+
+echo
+echo "Now type 'make' to compile libxslt."
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 00000000..be5dcb92
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,7 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
diff --git a/configure.in b/configure.in
new file mode 100644
index 00000000..86e9dc69
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,105 @@
+AC_INIT(libxslt/xslt.c)
+
+VERSION=0.0
+PACKAGE=libxslt
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
+AM_MAINTAINER_MODE
+
+dnl
+dnl The following new parameters were added to offer
+dnl the ability to specify the location of the libxml
+dnl library during linking and compilation.
+dnl Mathieu Lacage 30/03/2000
+dnl
+LIBXML_PREFIX=""
+AC_ARG_WITH(libxml-prefix,
+ [ --with-libxml-prefix=[PFX] Specify location of libxml],
+ LIBXML_PREFIX=$withval
+)
+
+AC_ARG_WITH(libxml-include-prefix,
+ [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
+ LIBXML_CFLAGS="-I$withval"
+)
+
+AC_ARG_WITH(libxml-libs-prefix,
+ [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
+ LIBXML_LIBS="-L$withval -lxml -lz"
+)
+
+
+dnl
+dnl Check the environment
+dnl
+
+AC_ISC_POSIX
+AC_PROG_CC
+AC_STDC_HEADERS
+AC_ARG_PROGRAM
+AM_PROG_LIBTOOL
+
+dnl No internationalization (yet ?)
+dnl
+dnl ALL_LINGUAS="it ko fr de es no ga sv pt ja fi cs"
+dnl AM_GNU_GETTEXT
+dnl
+dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+
+dnl
+dnl find libxml
+dnl
+XML_CONFIG="xml-config"
+AC_MSG_CHECKING(for libxml libraries >= 2.x)
+if test "x$LIBXML_PREFIX" != "x"
+then
+ if ${LIBXML_PREFIX}/bin/xml-config --libs print > /dev/null 2>&1
+ then
+ XML_CONFIG=${LIBXML_PREFIX}/bin/xml-config
+ else
+ XML_CONFIG=xml-config
+ fi
+fi
+
+dnl
+dnl test version and init our variables
+dnl
+if test "x$XML_CONFIG" != "x"
+then
+ vers=`$XML_CONFIG --version | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+ if test "$vers" -ge 2000000
+ then
+ LIBXML_LIBS="`$XML_CONFIG --libs`"
+ LIBXML_CFLAGS="`$XML_CONFIG --cflags`"
+ AC_MSG_RESULT(found)
+ else
+ AC_MSG_ERROR(You need at least libxml 2.x for this version of libxml)
+ fi
+else
+ AC_MSG_ERROR(Could not find libxml anywhere.)
+fi
+
+
+AC_SUBST(XML_CONFIG)
+AC_SUBST(LIBXML_LIBS)
+AC_SUBST(LIBXML_CFLAGS)
+
+XSLT_LIBDIR='-L${libdir}'
+XSLT_INCLUDEDIR='-I${includedir}'
+XSLT_LIBS="-lxslt $LIBXML_LIBS"
+
+AC_SUBST(XSLT_LIBDIR)
+AC_SUBST(XSLT_INCLUDEDIR)
+AC_SUBST(XSLT_LIBS)
+
+AC_OUTPUT([
+Makefile
+libxslt/Makefile
+tests/Makefile
+xslt-config
+])
diff --git a/libxslt/Makefile.am b/libxslt/Makefile.am
new file mode 100644
index 00000000..eea81b53
--- /dev/null
+++ b/libxslt/Makefile.am
@@ -0,0 +1,25 @@
+INCLUDES = -I$(top_srcdir)/libxslt \
+ $(LIBXML_CFLAGS) -Wall -ansi
+
+lib_LTLIBRARIES = libxslt.la
+
+libxslt_la_SOURCES = \
+ xslt.c \
+ xslt.h \
+ xsltInternals.h
+
+
+
+# what is this include dir ?
+# libxsltincdir = $(includedir)/libxslt
+
+noinst_PROGRAMS = xsltproc
+
+DEPS = $(top_builddir)/libxslt/libxslt.la
+LDADDS = $(top_builddir)/libxslt/libxslt.la $(LIBXML_LIBS)
+
+xsltproc_SOURCES = xsltproc.c
+xsltproc_LDFLAGS =
+xsltproc_DEPENDENCIES = $(DEPS)
+xsltproc_LDADD = $(LDADDS)
+
diff --git a/libxslt/xslt.c b/libxslt/xslt.c
new file mode 100644
index 00000000..c92cf7db
--- /dev/null
+++ b/libxslt/xslt.c
@@ -0,0 +1,54 @@
+/*
+ * xslt.h: Implemetation of an XSL Transformation 1.0 engine
+ *
+ * Reference:
+ * http://www.w3.org/TR/1999/REC-xslt-19991116
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@imag.fr
+ */
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxslt/xslt.h>
+#include <libxslt/xsltInternals.h>
+
+/************************************************************************
+ * *
+ * Routines to handle XSLT data structures *
+ * *
+ ************************************************************************/
+
+/**
+ * xsltFreeStylesheet:
+ * @sheet: an XSLT stylesheet
+ *
+ * Free up the memory allocated by @sheet
+ */
+void
+xsltFreeStylesheet(xsltStylesheetPtr sheet) {
+}
+
+/************************************************************************
+ * *
+ * Parsing of an XSLT Stylesheet *
+ * *
+ ************************************************************************/
+
+/**
+ * xsltParseStylesheetFile:
+ * @filename: the filename/URL to the stylesheet
+ *
+ * Load and parse an XSLT stylesheet
+ *
+ * Returns a new XSLT stylesheet structure.
+ */
+
+xsltStylesheetPtr
+xsltParseStylesheetFile(const xmlChar* filename) {
+ xsltStylesheetPtr ret;
+
+ return(ret);
+}
+
diff --git a/libxslt/xslt.h b/libxslt/xslt.h
new file mode 100644
index 00000000..516da332
--- /dev/null
+++ b/libxslt/xslt.h
@@ -0,0 +1,28 @@
+/*
+ * xslt.h: Interfaces, constants and types related to the XSLT engine
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@imag.fr
+ */
+
+#ifndef __XML_XSLT_H__
+#define __XML_XSLT_H__
+
+#include <libxml/tree.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Constants.
+ */
+#define XSLT_DEFAULT_VERSION "1.0"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XML_XSLT_H__ */
+
diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
new file mode 100644
index 00000000..c59d7804
--- /dev/null
+++ b/libxslt/xsltInternals.h
@@ -0,0 +1,36 @@
+/*
+ * xsltInternals.h: internal data structures, constants and functions used
+ * by the XSLT engine
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@imag.fr
+ */
+
+#ifndef __XML_XSLT_INTERNALS_H__
+#define __XML_XSLT_INTERNALS_H__
+
+#include <libxml/tree.h>
+#include <libxml/hash.h>
+#include <libxslt/xslt.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _xsltStylesheet xsltStylesheet;
+typedef xsltStylesheet *xsltStylesheetPtr;
+struct _xsltStylesheet {
+};
+
+/*
+ * Functions associated to the internal types
+ */
+xsltStylesheetPtr xsltParseStylesheetFile (const xmlChar* filename);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XML_XSLT_H__ */
+
diff --git a/libxslt/xsltproc.c b/libxslt/xsltproc.c
new file mode 100644
index 00000000..56c5cd6b
--- /dev/null
+++ b/libxslt/xsltproc.c
@@ -0,0 +1,37 @@
+/*
+ * xsltproc.c: user program for the XSL Transformation 1.0 engine
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@imag.fr
+ */
+
+#include <libxslt/xslt.h>
+#include <libxslt/xsltInternals.h>
+
+static int debug = 0;
+
+int
+main(int argc, char **argv) {
+ int i, count;
+ int files = 0;
+ xsltStylesheetPtr cur;
+
+ LIBXML_TEST_VERSION
+ for (i = 1; i < argc ; i++) {
+ if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
+ debug++;
+ }
+ xmlSubstituteEntitiesDefault(1);
+ for (i = 1; i < argc ; i++) {
+ if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
+ cur = xsltParseStylesheetFile(argv[i]);
+ xsltFreeStylesheet(cur);
+ break;
+ }
+ }
+ xmlCleanupParser();
+ xmlMemoryDump();
+ return(0);
+}
+
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 00000000..083886fc
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,19 @@
+## Process this file with automake to produce Makefile.in
+
+INCLUDES = -I$(srcdir) -I$(top_srcdir)/libxslt \
+ $(LIBXML_CFLAGS) -Wall -ansi
+
+noinst_PROGRAMS = # testxslt testevents
+
+DEPS = $(top_builddir)/libxslt/libxslt.la
+LDADDS = $(top_builddir)/libxslt/libxslt.la $(LIBXML_LIBS)
+
+#testxslt_SOURCES = test-xslt.c
+#testxslt_LDFLAGS =
+#testxslt_DEPENDENCIES = $(DEPS)
+#testxslt_LDADD = $(LDADDS)
+#
+#testevents_SOURCES = test-events.c
+#testevents_LDFLAGS =
+#testevents_DEPENDENCIES = $(DEPS)
+#testevents_LDADD = $(LDADDS)
diff --git a/tests/REC1/doc.dtd b/tests/REC1/doc.dtd
new file mode 100644
index 00000000..f06b4dc4
--- /dev/null
+++ b/tests/REC1/doc.dtd
@@ -0,0 +1,7 @@
+<!ELEMENT doc (title, chapter*)>
+<!ELEMENT chapter (title, (para|note)*, section*)>
+<!ELEMENT section (title, (para|note)*)>
+<!ELEMENT title (#PCDATA|emph)*>
+<!ELEMENT para (#PCDATA|emph)*>
+<!ELEMENT note (#PCDATA|emph)*>
+<!ELEMENT emph (#PCDATA|emph)*>
diff --git a/tests/REC1/doc.xml b/tests/REC1/doc.xml
new file mode 100644
index 00000000..0bad2544
--- /dev/null
+++ b/tests/REC1/doc.xml
@@ -0,0 +1,17 @@
+<!DOCTYPE doc SYSTEM "doc.dtd">
+<doc>
+<title>Document Title</title>
+<chapter>
+<title>Chapter Title</title>
+<section>
+<title>Section Title</title>
+<para>This is a test.</para>
+<note>This is a note.</note>
+</section>
+<section>
+<title>Another Section Title</title>
+<para>This is <emph>another</emph> test.</para>
+<note>This is another note.</note>
+</section>
+</chapter>
+</doc>
diff --git a/tests/REC1/doc.xsl b/tests/REC1/doc.xsl
new file mode 100644
index 00000000..bcc60a4d
--- /dev/null
+++ b/tests/REC1/doc.xsl
@@ -0,0 +1,62 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/TR/xhtml1/strict">
+
+<xsl:strip-space elements="doc chapter section"/>
+<xsl:output
+ method="xml"
+ indent="yes"
+ encoding="iso-8859-1"
+/>
+
+<xsl:template match="doc">
+<html>
+ <head>
+ <title>
+ <xsl:value-of select="title"/>
+ </title>
+ </head>
+ <body>
+ <xsl:apply-templates/>
+ </body>
+</html>
+</xsl:template>
+
+<xsl:template match="doc/title">
+<h1>
+ <xsl:apply-templates/>
+</h1>
+</xsl:template>
+
+<xsl:template match="chapter/title">
+<h2>
+ <xsl:apply-templates/>
+</h2>
+</xsl:template>
+
+<xsl:template match="section/title">
+<h3>
+ <xsl:apply-templates/>
+</h3>
+</xsl:template>
+
+<xsl:template match="para">
+<p>
+ <xsl:apply-templates/>
+</p>
+</xsl:template>
+
+<xsl:template match="note">
+<p class="note">
+ <b>NOTE: </b>
+ <xsl:apply-templates/>
+</p>
+</xsl:template>
+
+<xsl:template match="emph">
+<em>
+ <xsl:apply-templates/>
+</em>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/REC1/result.xml b/tests/REC1/result.xml
new file mode 100644
index 00000000..4504627e
--- /dev/null
+++ b/tests/REC1/result.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<html xmlns="http://www.w3.org/TR/xhtml1/strict">
+<head>
+<title>Document Title</title>
+</head>
+<body>
+<h1>Document Title</h1>
+<h2>Chapter Title</h2>
+<h3>Section Title</h3>
+<p>This is a test.</p>
+<p class="note">
+<b>NOTE: </b>This is a note.</p>
+<h3>Another Section Title</h3>
+<p>This is <em>another</em> test.</p>
+<p class="note">
+<b>NOTE: </b>This is another note.</p>
+</body>
+</html>
diff --git a/tests/REC2/data.xml b/tests/REC2/data.xml
new file mode 100644
index 00000000..a5437417
--- /dev/null
+++ b/tests/REC2/data.xml
@@ -0,0 +1,21 @@
+<sales>
+
+ <division id="North">
+ <revenue>10</revenue>
+ <growth>9</growth>
+ <bonus>7</bonus>
+ </division>
+
+ <division id="South">
+ <revenue>4</revenue>
+ <growth>3</growth>
+ <bonus>4</bonus>
+ </division>
+
+ <division id="West">
+ <revenue>6</revenue>
+ <growth>-1.5</growth>
+ <bonus>2</bonus>
+ </division>
+
+</sales>
diff --git a/tests/REC2/html.xml b/tests/REC2/html.xml
new file mode 100644
index 00000000..e62b965a
--- /dev/null
+++ b/tests/REC2/html.xml
@@ -0,0 +1,22 @@
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Sales Results By Division</title>
+</head>
+<body>
+<table border="1">
+<tr>
+<th>Division</th><th>Revenue</th><th>Growth</th><th>Bonus</th>
+</tr>
+<tr>
+<td><em>North</em></td><td>10</td><td>9</td><td>7</td>
+</tr>
+<tr>
+<td><em>West</em></td><td>6</td><td style="color:red">-1.5</td><td>2</td>
+</tr>
+<tr>
+<td><em>South</em></td><td>4</td><td>3</td><td>4</td>
+</tr>
+</table>
+</body>
+</html>
diff --git a/tests/REC2/html.xsl b/tests/REC2/html.xsl
new file mode 100644
index 00000000..1ca30134
--- /dev/null
+++ b/tests/REC2/html.xsl
@@ -0,0 +1,43 @@
+<html xsl:version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ lang="en">
+ <head>
+ <title>Sales Results By Division</title>
+ </head>
+ <body>
+ <table border="1">
+ <tr>
+ <th>Division</th>
+ <th>Revenue</th>
+ <th>Growth</th>
+ <th>Bonus</th>
+ </tr>
+ <xsl:for-each select="sales/division">
+ <!-- order the result by revenue -->
+ <xsl:sort select="revenue"
+ data-type="number"
+ order="descending"/>
+ <tr>
+ <td>
+ <em><xsl:value-of select="@id"/></em>
+ </td>
+ <td>
+ <xsl:value-of select="revenue"/>
+ </td>
+ <td>
+ <!-- highlight negative growth in red -->
+ <xsl:if test="growth &lt; 0">
+ <xsl:attribute name="style">
+ <xsl:text>color:red</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="growth"/>
+ </td>
+ <td>
+ <xsl:value-of select="bonus"/>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+</html>
diff --git a/tests/REC2/svg.xml b/tests/REC2/svg.xml
new file mode 100644
index 00000000..d134e9c7
--- /dev/null
+++ b/tests/REC2/svg.xml
@@ -0,0 +1,18 @@
+<svg width="3in" height="3in"
+ xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
+ <g style="stroke: #000000">
+ <line x1="0" x2="150" y1="150" y2="150"/>
+ <line x1="0" x2="0" y1="0" y2="150"/>
+ <text x="0" y="10">Revenue</text>
+ <text x="150" y="165">Division</text>
+ <rect x="10" y="50" width="20" height="100"/>
+ <text x="10" y="165">North</text>
+ <text x="10" y="45">10</text>
+ <rect x="50" y="110" width="20" height="40"/>
+ <text x="50" y="165">South</text>
+ <text x="50" y="105">4</text>
+ <rect x="90" y="90" width="20" height="60"/>
+ <text x="90" y="165">West</text>
+ <text x="90" y="85">6</text>
+ </g>
+</svg>
diff --git a/tests/REC2/svg.xsl b/tests/REC2/svg.xsl
new file mode 100644
index 00000000..cac685bd
--- /dev/null
+++ b/tests/REC2/svg.xsl
@@ -0,0 +1,45 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd">
+
+<xsl:output method="xml" indent="yes" media-type="image/svg"/>
+
+<xsl:template match="/">
+
+<svg width = "3in" height="3in">
+ <g style = "stroke: #000000">
+ <!-- draw the axes -->
+ <line x1="0" x2="150" y1="150" y2="150"/>
+ <line x1="0" x2="0" y1="0" y2="150"/>
+ <text x="0" y="10">Revenue</text>
+ <text x="150" y="165">Division</text>
+ <xsl:for-each select="sales/division">
+ <!-- define some useful variables -->
+
+ <!-- the bar's x position -->
+ <xsl:variable name="pos"
+ select="(position()*40)-30"/>
+
+ <!-- the bar's height -->
+ <xsl:variable name="height"
+ select="revenue*10"/>
+
+ <!-- the rectangle -->
+ <rect x="{$pos}" y="{150-$height}"
+ width="20" height="{$height}"/>
+
+ <!-- the text label -->
+ <text x="{$pos}" y="165">
+ <xsl:value-of select="@id"/>
+ </text>
+
+ <!-- the bar value -->
+ <text x="{$pos}" y="{145-$height}">
+ <xsl:value-of select="revenue"/>
+ </text>
+ </xsl:for-each>
+ </g>
+</svg>
+
+</xsl:template>
+</xsl:stylesheet>
diff --git a/tests/REC2/vrml.xml b/tests/REC2/vrml.xml
new file mode 100644
index 00000000..ddeb17b0
--- /dev/null
+++ b/tests/REC2/vrml.xml
@@ -0,0 +1,37 @@
+#VRML V2.0 utf8
+
+# externproto definition of a single bar element
+EXTERNPROTO bar [
+ field SFInt32 x
+ field SFInt32 y
+ field SFInt32 z
+ field SFString name
+ ]
+ "http://www.vrml.org/WorkingGroups/dbwork/barProto.wrl"
+
+# inline containing the graph axes
+Inline {
+ url "http://www.vrml.org/WorkingGroups/dbwork/barAxes.wrl"
+ }
+
+
+bar {
+ x 10
+ y 9
+ z 7
+ name "North"
+ }
+
+bar {
+ x 4
+ y 3
+ z 4
+ name "South"
+ }
+
+bar {
+ x 6
+ y -1.5
+ z 2
+ name "West"
+ }
diff --git a/tests/REC2/vrml.xsl b/tests/REC2/vrml.xsl
new file mode 100644
index 00000000..8c2e33e3
--- /dev/null
+++ b/tests/REC2/vrml.xsl
@@ -0,0 +1,34 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- generate text output as mime type model/vrml, using default charset -->
+<xsl:output method="text" encoding="UTF-8" media-type="model/vrml"/>
+
+ <xsl:template match="/">#VRML V2.0 utf8
+
+# externproto definition of a single bar element
+EXTERNPROTO bar [
+ field SFInt32 x
+ field SFInt32 y
+ field SFInt32 z
+ field SFString name
+ ]
+ "http://www.vrml.org/WorkingGroups/dbwork/barProto.wrl"
+
+# inline containing the graph axes
+Inline {
+ url "http://www.vrml.org/WorkingGroups/dbwork/barAxes.wrl"
+ }
+
+ <xsl:for-each select="sales/division">
+bar {
+ x <xsl:value-of select="revenue"/>
+ y <xsl:value-of select="growth"/>
+ z <xsl:value-of select="bonus"/>
+ name "<xsl:value-of select="@id"/>"
+ }
+ </xsl:for-each>
+
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xslt-config.in b/xslt-config.in
new file mode 100644
index 00000000..b66fb31f
--- /dev/null
+++ b/xslt-config.in
@@ -0,0 +1,127 @@
+#! /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+includedir=@includedir@
+libdir=@libdir@
+
+usage()
+{
+ cat <<EOF
+Usage: xslt-config [OPTION]...
+
+Known values for OPTION are:
+
+ --prefix=DIR change XSLT prefix [default $prefix]
+ --exec-prefix=DIR change XSLT executable prefix [default $exec_prefix]
+ --libs print library linking information
+ --cflags print pre-processor and compiler flags
+ --help display this help and exit
+ --version output version information
+EOF
+
+ exit $1
+}
+
+if test $# -eq 0; then
+ usage 1
+fi
+
+cflags=false
+libs=false
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case "$1" in
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ ;;
+
+ --prefix)
+ echo $prefix
+ ;;
+
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+
+ --exec-prefix)
+ echo $exec_prefix
+ ;;
+
+ --version)
+ echo @VERSION@
+ exit 0
+ ;;
+
+ --help)
+ usage 0
+ ;;
+
+ --cflags)
+ cflags=true
+ ;;
+
+ --libs)
+ libs=true
+ ;;
+
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+the_libs="$the_libs -L$libdir -lxslt `@XML_CONFIG@ --libs`"
+the_flags="$the_flags -I$includedir `@XML_CONFIG@ --cflags`"
+
+if $cflags; then
+ all_flags="$the_flags"
+fi
+
+if $libs; then
+ all_flags="$all_flags $services $the_libs"
+fi
+
+if test -z "$all_flags" || test "x$all_flags" = "x "; then
+ exit 1
+fi
+
+# Straight out any possible duplicates, but be careful to
+# get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
+other_flags=
+rev_libs=
+for i in $all_flags; do
+ case "$i" in
+ # a library, save it for later, in reverse order
+ -l*) rev_libs="$i $rev_libs" ;;
+ *)
+ case " $other_flags " in
+ *\ $i\ *) ;; # already there
+ *) other_flags="$other_flags $i" ;; # add it to output
+ esac ;;
+ esac
+done
+
+ord_libs=
+for i in $rev_libs; do
+ case " $ord_libs " in
+ *\ $i\ *) ;; # already there
+ *) ord_libs="$i $ord_libs" ;; # add it to output in reverse order
+ esac
+done
+
+echo $other_flags $ord_libs
+
+exit 0
diff --git a/xsltConf.sh.in b/xsltConf.sh.in
new file mode 100644
index 00000000..666774b6
--- /dev/null
+++ b/xsltConf.sh.in
@@ -0,0 +1,7 @@
+#
+# Configuration file for using the xslt library
+#
+XSLT_LIBDIR="@XSLT_LIBDIR@"
+XSLT_LIBS="@XSLT_LIBS@"
+XSLT_INCLUDEDIR="@XSLT_INCLUDEDIR@"
+MODULE_VERSION="xslt-@VERSION@"